diff options
author | Derek Schuff <dschuff@chromium.org> | 2016-03-08 15:26:42 -0800 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2016-03-08 15:26:42 -0800 |
commit | ec003c7b1ab24a0b2248664c2278a32439f56862 (patch) | |
tree | 50faa06db84cf52f778b523dc2bfd287a6ea07ba /src | |
parent | 6c12704bf58c32a1c1436f53e5d8994452a273fd (diff) | |
download | binaryen-ec003c7b1ab24a0b2248664c2278a32439f56862.tar.gz binaryen-ec003c7b1ab24a0b2248664c2278a32439f56862.tar.bz2 binaryen-ec003c7b1ab24a0b2248664c2278a32439f56862.zip |
Update s2wasm for tableswitch->br_table change
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")) { |