diff options
Diffstat (limited to 'src/wasm/wasm.cpp')
-rw-r--r-- | src/wasm/wasm.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index 6245a3575..ac76a63ac 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -73,6 +73,8 @@ Name TABLE("table"); Name ELEM("elem"); Name LOCAL("local"); Name TYPE("type"); +Name REF("ref"); +Name NULL_("null"); Name CALL("call"); Name CALL_INDIRECT("call_indirect"); Name BLOCK("block"); @@ -212,6 +214,8 @@ const char* getExpressionName(Expression* curr) { return "i31.new"; case Expression::Id::I31GetId: return "i31.get"; + case Expression::Id::CallRefId: + return "call_ref"; case Expression::Id::RefTestId: return "ref.test"; case Expression::Id::RefCastId: @@ -1060,6 +1064,21 @@ void I31Get::finalize() { } } +void CallRef::finalize() { + handleUnreachableOperands(this); + if (isReturn) { + type = Type::unreachable; + } + if (target->type == Type::unreachable) { + type = Type::unreachable; + } +} + +void CallRef::finalize(Type type_) { + type = type_; + finalize(); +} + // TODO (gc): ref.test // TODO (gc): ref.cast // TODO (gc): br_on_cast |