[webkit-changes] [WebKit/WebKit] 8f488e: [WGSL] Validate constraints on type variables when...
Tadeu Zagallo
noreply at github.com
Thu Mar 30 08:13:12 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8f488e02e9be1fff9a916ce0d395b05e5bc0134b
https://github.com/WebKit/WebKit/commit/8f488e02e9be1fff9a916ce0d395b05e5bc0134b
Author: Tadeu Zagallo <tzagallo at apple.com>
Date: 2023-03-30 (Thu, 30 Mar 2023)
Changed paths:
M Source/WebGPU/WGSL/Overload.cpp
M Source/WebGPU/WGSL/Overload.h
M Source/WebGPU/WGSL/tests/invalid/overload.wgsl
Log Message:
-----------
[WGSL] Validate constraints on type variables when resolving overloads
https://bugs.webkit.org/show_bug.cgi?id=254669
rdar://problem/107370152
Reviewed by Myles C. Maxfield.
Type variables don't always accept any type, they usually have constraints such
as "the type must be a floating point" or the like. We were already specifying
the constraints, but not validating it. This patch modifies Overload::assign
to validate that a type actually satisfies the constraints before the assignment.
* Source/WebGPU/WGSL/Overload.cpp:
(WGSL::OverloadResolver::considerCandidate):
(WGSL::OverloadResolver::unify):
(WGSL::OverloadResolver::assign):
* Source/WebGPU/WGSL/Overload.h:
* Source/WebGPU/WGSL/tests/invalid/overload.wgsl:
Canonical link: https://commits.webkit.org/262328@main
More information about the webkit-changes
mailing list