diff options
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r-- | src/wasm-interpreter.h | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 257a0670f..b0118231e 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -1270,7 +1270,24 @@ public: throwException(flow.getSingleValue()); WASM_UNREACHABLE("rethrow"); } - Flow visitBrOnExn(BrOnExn* curr) { WASM_UNREACHABLE("unimp"); } + Flow visitBrOnExn(BrOnExn* curr) { + NOTE_ENTER("BrOnExn"); + Flow flow = this->visit(curr->exnref); + if (flow.breaking()) { + return flow; + } + if (flow.getType() == Type::nullref) { + trap("br_on_exn: argument is null"); + } + const ExceptionPackage& ex = flow.getSingleValue().getExceptionPackage(); + if (curr->event != ex.event) { // Not taken + return flow; + } + // Taken + flow.values = ex.values; + flow.breakTo = curr->name; + return flow; + } virtual void trap(const char* why) { WASM_UNREACHABLE("unimp"); } @@ -1514,10 +1531,6 @@ public: NOTE_ENTER("Try"); return Flow(NONCONSTANT_FLOW); } - Flow visitBrOnExn(BrOnExn* curr) { - NOTE_ENTER("BrOnExn"); - return Flow(NONCONSTANT_FLOW); - } void trap(const char* why) override { throw NonconstantException(); } @@ -2410,24 +2423,6 @@ private: return this->visit(curr->catchBody); } } - Flow visitBrOnExn(BrOnExn* curr) { - NOTE_ENTER("BrOnExn"); - Flow flow = this->visit(curr->exnref); - if (flow.breaking()) { - return flow; - } - if (flow.getType() == Type::nullref) { - trap("br_on_exn: argument is null"); - } - const ExceptionPackage& ex = flow.getSingleValue().getExceptionPackage(); - if (curr->event != ex.event) { // Not taken - return flow; - } - // Taken - flow.values = ex.values; - flow.breakTo = curr->name; - return flow; - } Flow visitPush(Push* curr) { NOTE_ENTER("Push"); Flow value = this->visit(curr->value); |