Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8f488e02e9be1fff9a916ce0d395b05e5bc0134b
      
https://github.com/WebKit/WebKit/commit/8f488e02e9be1fff9a916ce0d395b05e5bc0134b
  Author: Tadeu Zagallo <[email protected]>
  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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to