Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cfcd3f2f153c669fa78dd6d679c001b82b66996e
      
https://github.com/WebKit/WebKit/commit/cfcd3f2f153c669fa78dd6d679c001b82b66996e
  Author: Tadeu Zagallo <tzaga...@apple.com>
  Date:   2023-05-29 (Mon, 29 May 2023)

  Changed paths:
    M Source/WebGPU/WGSL/TypeCheck.cpp
    M Source/WebGPU/WGSL/tests/invalid/vector.wgsl
    A Source/WebGPU/WGSL/tests/valid/swizzle.wgsl

  Log Message:
  -----------
  [WGSL] Incorrect swizzle validation
https://bugs.webkit.org/show_bug.cgi?id=257378
rdar://109886275

Reviewed by Mike Wyrzykowski.

Swizzle characters need to be checked for bounds, e.g. we can't access vec2.z,
but the original patch was incorrectly checking the offset of the swizzle 
against
the size of the resulting vector, not the vector we are loading from.

* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::vectorFieldAccess):
* Source/WebGPU/WGSL/tests/invalid/vector.wgsl:
* Source/WebGPU/WGSL/tests/valid/swizzle.wgsl: Added.

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to