Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 51cdfa635552c4c3e0fc3c4449af399b790ffc7f
https://github.com/WebKit/WebKit/commit/51cdfa635552c4c3e0fc3c4449af399b790ffc7f
Author: Tadeu Zagallo <[email protected]>
Date: 2023-08-07 (Mon, 07 Aug 2023)
Changed paths:
M Source/WebGPU/WGSL/Parser.cpp
M Tools/TestWebKitAPI/Tests/WGSL/ParserTests.cpp
Log Message:
-----------
[WGSL] Assertion failure when declarations have no type nor initializer
https://bugs.webkit.org/show_bug.cgi?id=259728
rdar://113258649
Reviewed by Dan Glastonbury.
We (correctly) assert that every variable declaration should (at least) have
either
a type annotation or an initializer expression. However, that is currently not
handled by the parser, so invalid programs result in an assertion failure. This
patch updates the parser according to the spec:
- const and let: optional type annotation and require an initializer
- override and var: optional type annotation and optional initializer, but at
least
one of the two must be present.
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parseVariableWithAttributes):
* Tools/TestWebKitAPI/Tests/WGSL/ParserTests.cpp:
(TEST):
Canonical link: https://commits.webkit.org/266633@main
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes