Update docs for BrTable.

This commit is contained in:
Sergey Pepyakin 2018-06-21 16:09:36 +03:00
parent 6647bc4090
commit 4ea0aee6f4
1 changed files with 8 additions and 2 deletions

View File

@ -111,9 +111,15 @@ pub enum Instruction {
BrIfEqz(Target), BrIfEqz(Target),
BrIfNez(Target), BrIfNez(Target),
/// Last one is the default. /// br_table [t1 t2 t3 .. tn] tdefault
/// ///
/// Can be less than zero. /// Pops the value from the stack. Then this value is used as an index
/// to the branch table.
///
/// However, the last target represents the default target. So if the index
/// is greater than length of the branch table, then the last index will be used.
///
/// Validation ensures that there should be at least one target.
BrTable(Box<[Target]>), BrTable(Box<[Target]>),
Unreachable, Unreachable,