diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-02 13:00:23 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-02 13:07:09 -0800 |
commit | 25a335b740da7e7f199edcad617251d19aa6b18b (patch) | |
tree | bf259819171a38a1eb57a170483a93fb6e501572 /src | |
parent | 1a9469b0ed84be32dc264effbe7736a03cb7b608 (diff) | |
download | binaryen-25a335b740da7e7f199edcad617251d19aa6b18b.tar.gz binaryen-25a335b740da7e7f199edcad617251d19aa6b18b.tar.bz2 binaryen-25a335b740da7e7f199edcad617251d19aa6b18b.zip |
abort on switches, for now
Diffstat (limited to 'src')
-rw-r--r-- | src/asm2wasm.h | 6 | ||||
-rw-r--r-- | src/wasm.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index e5ba3a499..7d8d4d47a 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -962,7 +962,11 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { return ret; } else if (what == SWITCH) { // XXX switch is still in flux in the spec repo, just emit a placeholder - return allocator.alloc<Nop>(); +#ifndef __EMSCRIPTEN__ + return allocator.alloc<Nop>(); // ignore in reference interpreter +#else + return allocator.alloc<Host>(); // XXX abort in wasm.js +#endif #if 0 IString name = getNextId("switch"); breakStack.push_back(name); diff --git a/src/wasm.h b/src/wasm.h index 95b44c344..e1ffe76a1 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -759,7 +759,7 @@ public: ExpressionList operands; std::ostream& doPrint(std::ostream &o, unsigned indent) { - abort(); + return printOpening(o, "host") << ')'; } }; |