From 4ea0aee6f4a59cbb2ccb8f68c2fa920b02c3b448 Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Thu, 21 Jun 2018 16:09:36 +0300 Subject: [PATCH] Update docs for BrTable. --- src/isa.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/isa.rs b/src/isa.rs index 3a4c543..5640c7a 100644 --- a/src/isa.rs +++ b/src/isa.rs @@ -111,9 +111,15 @@ pub enum Instruction { BrIfEqz(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]>), Unreachable,