diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/s2wasm.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h index 16b1125e8..b1c5f7c54 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -957,6 +957,16 @@ class S2WasmBuilder { } else if (match("end_loop")) { bstack.pop_back(); bstack.pop_back(); + } else if (match("br_table")) { + auto curr = allocator.alloc<Switch>(); + curr->condition = getInput(); + while (skipComma()) { + curr->targets.push_back(getBranchLabel(getInt())); + } + assert(curr->targets.size() > 0); + curr->default_ = curr->targets.back(); + curr->targets.pop_back(); + addToBlock(curr); } else if (match("br")) { auto curr = allocator.alloc<Break>(); bool hasCondition = false; @@ -991,15 +1001,6 @@ class S2WasmBuilder { curr->value = getInput(); } addToBlock(curr); - } else if (match("tableswitch")) { - auto curr = allocator.alloc<Switch>(); - curr->condition = getInput(); - skipComma(); - curr->default_ = getBranchLabel(getInt()); - while (skipComma()) { - curr->targets.push_back(getBranchLabel(getInt())); - } - addToBlock(curr); } else if (match("unreachable")) { addToBlock(allocator.alloc<Unreachable>()); } else if (match("memory_size")) { |