[webkit-changes] [WebKit/WebKit] d463a8: [WGSL] CompoundStatement should introduce a new scope

Tadeu Zagallo noreply at github.com
Tue Mar 28 00:24:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d463a81e081d8d8662cb740b7a8c7d04ab34767d
      https://github.com/WebKit/WebKit/commit/d463a81e081d8d8662cb740b7a8c7d04ab34767d
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-03-28 (Tue, 28 Mar 2023)

  Changed paths:
    M Source/WebGPU/WGSL/MangleNames.cpp
    M Source/WebGPU/WGSL/TypeCheck.cpp
    A Source/WebGPU/WGSL/tests/valid/scope.wgsl

  Log Message:
  -----------
  [WGSL] CompoundStatement should introduce a new scope
https://bugs.webkit.org/show_bug.cgi?id=254523
rdar://107267001

Reviewed by Myles C. Maxfield.

Two sibling CompooundStatements (blocks) should have their own scopes, and therefore
be able to introduce variables with the same name.
This patch also includes a test file, which depends on PR #11995 to be executed,
and for now can only be executed manually.

* Source/WebGPU/WGSL/MangleNames.cpp:
(WGSL::NameManglerVisitor::visit):
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visitFunctionBody):
(WGSL::TypeChecker::visit):
* Source/WebGPU/WGSL/tests/valid/scope.wgsl: Added.

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




More information about the webkit-changes mailing list