Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 82a09825dd6e6bc0b87a6e2847d735282b60d6cc
      
https://github.com/WebKit/WebKit/commit/82a09825dd6e6bc0b87a6e2847d735282b60d6cc
  Author: Tadeu Zagallo <[email protected]>
  Date:   2024-06-25 (Tue, 25 Jun 2024)

  Changed paths:
    M Source/WebGPU/WGSL/AST/ASTVariable.h
    M Source/WebGPU/WGSL/TypeCheck.cpp
    A Source/WebGPU/WGSL/tests/valid/fuzz-130092499.wgsl

  Log Message:
  -----------
  [WGSL] Pointer rewriting causes variables to have the wrong type
https://bugs.webkit.org/show_bug.cgi?id=275816
rdar://130092499

Reviewed by Mike Wyrzykowski.

The type checker can update the type of a variable's initializer expression to 
satisfy
the constraints on initializers, in this case a variable cannot have a 
reference type,
so it updates the expression to have the reference's underlying type (e.g. i32& 
becomes
i32). However, during pointer rewriting the initializer expression can change, 
erasing
the type coercion. To fix that, we now save the computed "store type" for the 
variable
in the AST::Variable node itself, so that it's preserved even if the 
initializer changes.

* Source/WebGPU/WGSL/AST/ASTVariable.h:
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visit):
* Source/WebGPU/WGSL/tests/valid/fuzz-130092499.wgsl: Added.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to