[webkit-changes] [WebKit/WebKit] 291703: [WGSL] Do not convert constant where there was a t...

Tadeu Zagallo noreply at github.com
Thu Nov 9 01:45:11 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 291703d07512d596b4b2e781ecc4301cc768f421
      https://github.com/WebKit/WebKit/commit/291703d07512d596b4b2e781ecc4301cc768f421
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-11-09 (Thu, 09 Nov 2023)

  Changed paths:
    M Source/WebGPU/WGSL/ConstantFunctions.h
    M Source/WebGPU/WGSL/TypeCheck.cpp
    M Source/WebGPU/WGSL/tests/invalid/overload.wgsl

  Log Message:
  -----------
  [WGSL] Do not convert constant where there was a type error
https://bugs.webkit.org/show_bug.cgi?id=264427
rdar://118129205

Reviewed by Mike Wyrzykowski.

The constant version code has a strong assumption that typing is correct, i.e. it
assumes that the current type is compatible with the target type. That was causing
an assertion failure when initializing a variable with a constant of an incompatible
type, since we failed type checking but still tried to convert the constant.

* Source/WebGPU/WGSL/ConstantFunctions.h:
(WGSL::CONSTANT_FUNCTION):
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visitVariable):
* Source/WebGPU/WGSL/tests/invalid/overload.wgsl:

Canonical link: https://commits.webkit.org/270437@main




More information about the webkit-changes mailing list