WebKit Bugzilla
Attachment 348568 Details for
Bug 189175
: [WHLSL] Fix array indexing behavior
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189175-20180830164733.patch (text/plain), 3.17 KB, created by
Thomas Denney
on 2018-08-30 16:47:34 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Thomas Denney
Created:
2018-08-30 16:47:34 PDT
Size:
3.17 KB
patch
obsolete
>Subversion Revision: 235532 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 5504221681915f596acbcbc36bea2b9b83db984d..9f89235afdba2cb965e2b39491957d169af68c6d 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,14 @@ >+2018-08-30 Thomas Denney <tdenney@apple.com> >+ >+ [WHLSL] Fix array indexing behavior >+ https://bugs.webkit.org/show_bug.cgi?id=189175 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebGPUShadingLanguageRI/Parse.js: >+ (parseType): >+ * WebGPUShadingLanguageRI/Test.js: >+ > 2018-08-30 Wenson Hsieh <wenson_hsieh@apple.com> > > Followup to [iOS] TestWebKitAPI.PasteImage tests are flaky failures >diff --git a/Tools/WebGPUShadingLanguageRI/Parse.js b/Tools/WebGPUShadingLanguageRI/Parse.js >index a20248d3619c050f7d4b38a2ea0cd0b29f2c1879..da47142f51907827ba376e6826f32af52165e2d8 100644 >--- a/Tools/WebGPUShadingLanguageRI/Parse.js >+++ b/Tools/WebGPUShadingLanguageRI/Parse.js >@@ -259,24 +259,35 @@ function parse(program, origin, originKind, lineNumberOffset, text) > return consume(...addressSpaces).text; > } > >+ const typeConstructorStack = [ ]; >+ > while (token = tryConsume("*", "[")) { >+ // token is updated each iteration, so constructors must use the token associated with their iteration. >+ const tokenCopy = token; > if (token.text == "*") { >- type = new PtrType(token, getAddressSpace(), type); >+ // Likewise, the address space must be parsed before parsing continues. >+ const addressSpace = getAddressSpace(); >+ typeConstructorStack.unshift(type => new PtrType(tokenCopy, addressSpace, type)); > continue; > } >- >+ > if (tryConsume("]")) { >- type = new ArrayRefType(token, getAddressSpace(), type); >+ const addressSpace = getAddressSpace(); >+ typeConstructorStack.unshift(type => new ArrayRefType(tokenCopy, addressSpace, type)); > continue; > } >- >- type = new ArrayType(token, type, parseConstexpr()); >+ >+ const lengthExpr = parseConstexpr(); >+ typeConstructorStack.unshift(type => new ArrayType(tokenCopy, type, lengthExpr)); > consume("]"); > } >- >+ >+ for (let constructor of typeConstructorStack) >+ type = constructor(type); >+ > if (addressSpace && !addressSpaceConsumed) > lexer.fail("Address space specified for type that does not need address space"); >- >+ > return type; > } > >diff --git a/Tools/WebGPUShadingLanguageRI/Test.js b/Tools/WebGPUShadingLanguageRI/Test.js >index 000d05407115850ff30ec2366aeb185ac573dcd3..4a11c1858599778ff391b04f2635c5b71005df7f 100644 >--- a/Tools/WebGPUShadingLanguageRI/Test.js >+++ b/Tools/WebGPUShadingLanguageRI/Test.js >@@ -5551,7 +5551,7 @@ tests.matrixMultiplication = function() { > checkFloat(program, callFunction(program, "foo13", []), 29 * 7 + 43 * 11 + 61 * 13); > } > >-tests.DISABLED_arrayIndex = function() { >+tests.arrayIndex = function() { > let program = doPrep(` > uint innerArrayLength() { > int[2][3] array;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189175
:
348568
|
348570
|
348571