Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WGSL] Variables initializer shouldn't be a reference
https://bugs.webkit.org/show_bug.cgi?id=257601 rdar://110105334 Reviewed by Mike Wyrzykowski. When initializing a variable, the value used to initialize it should be unpacked if it's a reference. E.g.: var a = 0; var b = a; b = 1; The above program should not change the value of `a`, and references to `b` should have type `ref<i32>`, not `ref<ref<i32>>`. In order to fix that, when we infer the type of a variable initializer (which doesn't have an explicit type annotation), if the is a reference (as it would be for `a` in the example above, which would have type `ref<i32>`), we should use the referenced type instead (i.e. `i32` in this example) * Source/WebGPU/WGSL/TypeCheck.cpp: (WGSL::TypeChecker::visitVariable): Canonical link: https://commits.webkit.org/264860@main
- Loading branch information