Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions document/core/text/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,10 @@ Lexically, an |Toffset| or |Talign| phrase is considered a single :ref:`keyword
\production{memory argument} & \Tmemarg_N &::=&
o{:}\Toffset~~a{:}\Talign_N &\Rightarrow& \{ \ALIGN~n,~\OFFSET~o \} & (\iff a = 2^n) \\
\production{memory offset} & \Toffset &::=&
\text{offset{=}}o{:}\Tu32 &\Rightarrow& o \\ &&|&
\text{offset{=}}o{:}\Tu64 &\Rightarrow& o \\ &&|&
\epsilon &\Rightarrow& 0 \\
\production{memory alignment} & \Talign_N &::=&
\text{align{=}}a{:}\Tu32 &\Rightarrow& a \\ &&|&
\text{align{=}}a{:}\Tu64 &\Rightarrow& a \\ &&|&
\epsilon &\Rightarrow& N \\
\production{instruction} & \Tplaininstr_I &::=& \dots \phantom{averylonginstructionnameforvectext} && \phantom{vechasreallylonginstructionnames} \\ &&|&
\text{i32.load}~~x{:}\Tmemidx~~m{:}\Tmemarg_4 &\Rightarrow& \I32.\LOAD~x~m \\ &&|&
Expand Down
22 changes: 22 additions & 0 deletions test/core/align.wast
Original file line number Diff line number Diff line change
Expand Up @@ -1000,3 +1000,25 @@
)
"malformed memop flags"
)

;; Max align and offset in non-malformed text
(module
(memory i64 1)
(func
i64.const 0
i32.load offset=0xFFFF_FFFF_FFFF_FFFF
drop
)
)

(assert_invalid
(module
(memory 1)
(func
i32.const 0
i32.load offset=0xFFFF_FFFF_FFFF_FFFF align=0x8000_0000_0000_0000
drop
)
)
"alignment must not be larger than natural"
)