br_if
Conditionally branch to a label depth.
core0x0D
Syntax
br_if
Stack Effect
label arity + [i32] -> branch or continueOpcode
- Hex
0x0D- Decimal
13- Bytes
[0x0d]- Encoding
0x0D <labelidx:u32-leb128>- Immediates
labelidx:u32-leb128— branch target depth
- 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
;; br_if example
)