Commit 083dc3e
committed
[WGSL] Function parameters have incorrect scope
https://bugs.webkit.org/show_bug.cgi?id=274602
rdar://128625182
Reviewed by Mike Wyrzykowski.
The parameters were being placed in a separate scope from the function local variables,
allowing a local variable to shadow a parameter, which shouldn't be valid according to
the spec.
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visit):
* Source/WebGPU/WGSL/tests/invalid/shadowing.wgsl: Added.
Canonical link: https://commits.webkit.org/279262@main1 parent 666a7c0 commit 083dc3e
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
725 | | - | |
| 725 | + | |
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments