Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0db7d09bde23910e479e714aff930fc453b5e926
      
https://github.com/WebKit/WebKit/commit/0db7d09bde23910e479e714aff930fc453b5e926
  Author: Tadeu Zagallo <[email protected]>
  Date:   2023-08-07 (Mon, 07 Aug 2023)

  Changed paths:
    M Source/WebGPU/WGSL/ContextProvider.h
    M Source/WebGPU/WGSL/ContextProviderInlines.h
    M Source/WebGPU/WGSL/MangleNames.cpp
    M Source/WebGPU/WGSL/TypeCheck.cpp
    A Source/WebGPU/WGSL/tests/invalid/redeclaration.wgsl

  Log Message:
  -----------
  [WGSL] Variable redeclaration should not assert
https://bugs.webkit.org/show_bug.cgi?id=259727
rdar://113257297

Reviewed by Dan Glastonbury.

Currently, when inserting a new value or type into the type checker context we
assert that the context doesn't already have another entry with the same name.
Instead, we should report an error informing that it's invalid to redeclare
that value/type.

* Source/WebGPU/WGSL/ContextProvider.h:
* Source/WebGPU/WGSL/ContextProviderInlines.h:
(WGSL::ContextProvider<Value>::Context::add):
(WGSL::ContextProvider<Value>::introduceVariable const):
* Source/WebGPU/WGSL/MangleNames.cpp:
(WGSL::NameManglerVisitor::introduceVariable):
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::TypeChecker):
(WGSL::TypeChecker::introduceType):
(WGSL::TypeChecker::introduceValue):
* Source/WebGPU/WGSL/tests/invalid/redeclaration.wgsl: Added.

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


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

Reply via email to