WebKit Bugzilla
Attachment 348405 Details for
Bug 189083
: [WHLSL] Ensure that isLValue is copied by the rewriter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189083-20180829095919.patch (text/plain), 2.96 KB, created by
Thomas Denney
on 2018-08-29 09:59:20 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Thomas Denney
Created:
2018-08-29 09:59:20 PDT
Size:
2.96 KB
patch
obsolete
>Subversion Revision: 235463 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 6c746cfa1caeaf05b4aa96c3d5566a71f8be6383..4d12276f87e0422019d4149e17850af06145ed1c 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,18 @@ >+2018-08-29 Thomas Denney <tdenney@apple.com> >+ >+ [WHLSL] Ensure that isLValue is copied by the rewriter >+ https://bugs.webkit.org/show_bug.cgi?id=189083 >+ >+ The value of isLValue was not propagated when new TernaryExpressions are >+ created in Rewriter. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebGPUShadingLanguageRI/Rewriter.js: >+ (Rewriter.prototype.visitTernaryExpression): >+ * WebGPUShadingLanguageRI/Test.js: Add new test to verify the value is >+ propagated. >+ > 2018-08-29 David Kilzer <ddkilzer@apple.com> > > Remove empty directories from from svn.webkit.org repository >diff --git a/Tools/WebGPUShadingLanguageRI/Rewriter.js b/Tools/WebGPUShadingLanguageRI/Rewriter.js >index 94d3a762e38fb921c584cbafff1f59478ebb791d..3c95020aa4d6c4bb093575ab40968a5cb54eb758 100644 >--- a/Tools/WebGPUShadingLanguageRI/Rewriter.js >+++ b/Tools/WebGPUShadingLanguageRI/Rewriter.js >@@ -167,7 +167,9 @@ class Rewriter { > > visitTernaryExpression(node) > { >- return new TernaryExpression(node.origin, node.predicate.visit(this), node.bodyExpression.visit(this), node.elseExpression.visit(this)); >+ let result = new TernaryExpression(node.origin, node.predicate.visit(this), node.bodyExpression.visit(this), node.elseExpression.visit(this)); >+ result.isLValue = node.isLValue; >+ return result; > } > > _handlePropertyAccessExpression(result, node) >diff --git a/Tools/WebGPUShadingLanguageRI/Test.js b/Tools/WebGPUShadingLanguageRI/Test.js >index 4f395a94cc7283dd62a004fa1d4c3b9faad30a61..fdc117308567e552890546c9b8199fb5767d3365 100644 >--- a/Tools/WebGPUShadingLanguageRI/Test.js >+++ b/Tools/WebGPUShadingLanguageRI/Test.js >@@ -260,6 +260,29 @@ tests.ternaryExpression = function() { > (e) => e instanceof WTypeError); > } > >+tests.ternaryExpressionIsLValue = function() { >+ function ternaryExpressionIsLValue(node) >+ { >+ let isLValue; >+ class TernaryExpressionVisitor extends Visitor { >+ visitTernaryExpression(node) >+ { >+ isLValue = node.isLValue; >+ } >+ } >+ node.visit(new TernaryExpressionVisitor()); >+ return isLValue; >+ } >+ >+ let program = doPrep(`int foo() { return 0 < 1 ? 0 : 1; }`); >+ if (ternaryExpressionIsLValue(program)) >+ throw new Error(`r-value ternary expression incorrectly parsed as l-value`); >+ >+ program = doPrep(`void foo() { int x; int y; (0 < 1 ? x : y) = 1; }`); >+ if (!ternaryExpressionIsLValue(program)) >+ throw new Error(`l-value ternary expression incorrectly parsed as r-value`); >+} >+ > tests.literalBool = function() { > let program = doPrep("bool foo() { return true; }"); > checkBool(program, callFunction(program, "foo", []), true);
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 189083
:
348403
| 348405