WSL should be fine with &foo()[i] if foo() returns a []
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Oct 2017 22:01:02 +0000 (22:01 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Oct 2017 22:01:02 +0000 (22:01 +0000)
commit55083c5c435b6531bd7d3a4b09dc67f301698c6a
tree050b869ecb29bae1e7e26f966060a1ff03c014c2
parentf74befa9d947fada8c28970cfec6ebe904822bf9
WSL should be fine with &foo()[i] if foo() returns a []
https://bugs.webkit.org/show_bug.cgi?id=177704

Reviewed by Saam Barati.

Previously, we'd determine if a property access expression (base.field or base[index]) was an lvalue by
asking if its base was an lvalue. This is right in all cases except if the base is of type []. Then, the
property access expression is an lvalue so long as there is a setter or ander.

This fixes the issue and adds a test.

Also, this makes error messages in the case that something is not an lvalue a lot better. If something
is not an lvalue because we could not find anders or setters, then we will tell you why we could not
find them.

* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitAssignment):
(Checker.prototype.visitReadModifyWriteExpression):
(Checker.prototype.visitMakePtrExpression):
(Checker.prototype._finishVisitingPropertyAccess):
* WebGPUShadingLanguageRI/DotExpression.js:
(DotExpression.prototype.get fieldName):
(DotExpression.prototype.get isLValue): Deleted.
(DotExpression.prototype.get addressSpace): Deleted.
* WebGPUShadingLanguageRI/IndexExpression.js:
(IndexExpression.prototype.get index):
(IndexExpression.prototype.get isLValue): Deleted.
(IndexExpression.prototype.get addressSpace): Deleted.
* WebGPUShadingLanguageRI/PropertyAccessExpression.js:
(PropertyAccessExpression):
(PropertyAccessExpression.prototype.get isLValue):
(PropertyAccessExpression.prototype.set isLValue):
* WebGPUShadingLanguageRI/PropertyResolver.js:
(PropertyResolver.prototype._visitRValuesWithinLValue.RValueFinder.prototype.visitMakeArrayRefExpression):
(PropertyResolver.prototype._visitRValuesWithinLValue.RValueFinder):
(PropertyResolver.prototype._visitRValuesWithinLValue):
* WebGPUShadingLanguageRI/Test.js:
(tests.storeNullArrayRef):
(tests.andReturnedArrayRef):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/WebGPUShadingLanguageRI/Checker.js
Tools/WebGPUShadingLanguageRI/DotExpression.js
Tools/WebGPUShadingLanguageRI/IndexExpression.js
Tools/WebGPUShadingLanguageRI/PropertyAccessExpression.js
Tools/WebGPUShadingLanguageRI/PropertyResolver.js
Tools/WebGPUShadingLanguageRI/Test.js
Tools/WebGPUShadingLanguageRI/Value.js