Skip to content

Bigger than natural alignment must throw a validation error #302

Closed
@bnjbvr

Description

@bnjbvr

These tests from https://github.com/WebAssembly/spec/blob/master/ml-proto/test/memory.wast#L49-L52 seem to contradict the rule from https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#memory-related-operators-described-here, especially:

As an additional validation criteria, the alignment must be less or equal to natural alignment.
;; Test alignment annotation rules
(module (memory 0) (func (i32.load8_u align=2 (i32.const 0))))
(module (memory 0) (func (i32.load16_u align=4 (i32.const 0))))
(module (memory 0) (func (i32.load align=8 (i32.const 0))))
(module (memory 0) (func (f32.load align=8 (i32.const 0))))

Is my understanding correct that these should throw at validation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions