Bug 248481 - Alignment assumed by RegisterAtOffsetList does not accurately describe SIMD registers
Summary: Alignment assumed by RegisterAtOffsetList does not accurately describe SIMD r...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Degazio
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-11-29 11:08 PST by David Degazio
Modified: 2022-11-30 12:53 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Degazio 2022-11-29 11:08:46 PST
rdar://102515450

The current RegisterAtOffsetList implementation assumes that the alignment of a register's value is the same as the width of that register. However, 128-bit SIMD registers are currently only aligned to eight-byte intervals. This mismatch between RegisterAtOffsetList's size calculation and other locations (such as in RegisterSetBuilder) can cause assertion failure. For example:

    (module
      (type (;0;) (func (result i32 v128)))
      (func (;0;) (type 0) (result i32 v128)
        (local v128)
        i32.const 0
        v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000
      )
      (export "foo" (func 0))
    )

...results in:

    ASSERTION FAILED: static_cast<size_t>(offset - startOffset) == sizeOfAreaInBytes
Comment 1 David Degazio 2022-11-29 11:32:01 PST
Pull request: https://github.com/WebKit/WebKit/pull/6929
Comment 2 EWS 2022-11-30 12:53:26 PST
Committed 257192@main (f958a5f2b00b): <https://commits.webkit.org/257192@main>

Reviewed commits have been landed. Closing PR #6929 and removing active labels.