loop
Structured loop target for backward branches.
core0x03
Syntax
loop
Stack Effect
entry stack -> exit stackOpcode
- Hex
0x03- Decimal
3- Bytes
[0x03]- Encoding
0x03 <blocktype:block-type>- Immediates
blocktype:block-type— empty | valtype | typeidx (encoded via signed LEB128)
- Category
- control
Browser Support
Core WebAssembly instruction.
Validation Rules
- Operands and result types must match the instruction signature.
- The instruction must appear in a valid structured control context.
Common Mistakes
- Using the instruction with the wrong operand type.
- Forgetting that WAT validation is stack-typed.
(func $example
;; loop example
)