[webkit-changes] [WebKit/WebKit] 6a7d10: [WGSL] Crash when measuring size of struct that co...

Tadeu Zagallo noreply at github.com
Fri Sep 22 04:04:57 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6a7d10f61b6b4f3853415c3a3fad23a536a227be
      https://github.com/WebKit/WebKit/commit/6a7d10f61b6b4f3853415c3a3fad23a536a227be
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-09-22 (Fri, 22 Sep 2023)

  Changed paths:
    M Source/WebGPU/WGSL/Types.cpp
    M Source/WebGPU/WGSL/tests/valid/packing.wgsl

  Log Message:
  -----------
  [WGSL] Crash when measuring size of struct that contains a runtime array
https://bugs.webkit.org/show_bug.cgi?id=261884
rdar://115843512

Reviewed by Dan Glastonbury.

We had an assertion that we would never ask for the size of a runtime-sized
array. However, we ask for the size of all member types for a struct that
intend to pack, and those can contain runtime-sized array, so the assertion
is incorrect. We just return the size of the element if it's runtime-sized,
which should be ok size @size attributes are not allowed on runtime-sized
arrays and they are always the last item in the struct.

* Source/WebGPU/WGSL/Types.cpp:
(WGSL::Type::size const):
* Source/WebGPU/WGSL/tests/valid/packing.wgsl:

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




More information about the webkit-changes mailing list