(block...)
Creates a code block that you can exit.
You have to manually branch to the bottom of the code block using either the br
or br_if
instructions.
Syntax
(block $label (param...) (result...))
block $label (param...) (result...)
...
end
Parameters
$label Optional
The name of the block. This is used with the branch instructions br
and br_if
.
Each code block, both loop
and block
, are given an index. The inner most code block
will have index 0 and its parent will have index 1, and so on.
Example
block $name_of_block_section
br $name_of_block_section
end