diff --git a/lib/fizzy/execute.cpp b/lib/fizzy/execute.cpp index e93d42a8c..60ef42c47 100644 --- a/lib/fizzy/execute.cpp +++ b/lib/fizzy/execute.cpp @@ -629,7 +629,8 @@ ExecutionResult execute(Instance& instance, FuncIdx func_idx, const Value* args, goto trap; // check actual type against expected type - const auto& actual_type = called_func->type; + const auto& actual_type = + called_func->instance->module->get_function_type(called_func->func_idx); const auto& expected_type = instance.module->typesec[expected_type_idx]; if (expected_type != actual_type) goto trap; diff --git a/lib/fizzy/instantiate.cpp b/lib/fizzy/instantiate.cpp index 76b12e138..2f3f3e3bc 100644 --- a/lib/fizzy/instantiate.cpp +++ b/lib/fizzy/instantiate.cpp @@ -330,7 +330,7 @@ std::unique_ptr instantiate(std::unique_ptr module, auto it_table = instance->table->begin() + elementsec_offsets[i]; for (const auto idx : instance->module->elementsec[i].init) { - *it_table++ = {instance.get(), idx, instance->module->get_function_type(idx), {}}; + *it_table++ = {instance.get(), idx, {}}; } } diff --git a/lib/fizzy/instantiate.hpp b/lib/fizzy/instantiate.hpp index 2adbde2d6..df83780cd 100644 --- a/lib/fizzy/instantiate.hpp +++ b/lib/fizzy/instantiate.hpp @@ -32,7 +32,6 @@ struct TableElement { Instance* instance; FuncIdx func_idx; - FuncType type; std::shared_ptr shared_instance; };