diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/literal.h | 7 | ||||
-rw-r--r-- | src/wasm-interpreter.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/literal.h b/src/literal.h index 625b3eb43..f96d6c7f5 100644 --- a/src/literal.h +++ b/src/literal.h @@ -71,7 +71,8 @@ public: explicit Literal(const std::array<Literal, 8>&); explicit Literal(const std::array<Literal, 4>&); explicit Literal(const std::array<Literal, 2>&); - explicit Literal(Name func) : func(func), type(Type::funcref) {} + explicit Literal(Name func, Type type = Type::funcref) + : func(func), type(type) {} explicit Literal(std::unique_ptr<ExceptionPackage>&& exn) : exn(std::move(exn)), type(Type::exnref) {} Literal(const Literal& other); @@ -233,7 +234,9 @@ public: assert(type.isNullable()); return Literal(type); } - static Literal makeFunc(Name func) { return Literal(func.c_str()); } + static Literal makeFunc(Name func, Type type = Type::funcref) { + return Literal(func, type); + } static Literal makeExn(std::unique_ptr<ExceptionPackage>&& exn) { return Literal(std::move(exn)); } diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 6f0d10565..406938a56 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -1289,7 +1289,7 @@ public: Flow visitRefFunc(RefFunc* curr) { NOTE_ENTER("RefFunc"); NOTE_NAME(curr->func); - return Literal::makeFunc(curr->func); + return Literal::makeFunc(curr->func, curr->type); } Flow visitRefEq(RefEq* curr) { NOTE_ENTER("RefEq"); |