local.tee
Write a local and keep the value on the stack.
core0x22
Syntax
local.tee
Stack Effect
[local type] -> [local type]Opcode
- Hex
0x22- Decimal
34- Bytes
[0x22]- Encoding
0x22 <localidx:u32-leb128>- Immediates
localidx:u32-leb128
- Category
- variable
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
;; local.tee example
)