Implement InitStartFunc without m3_Call and ensure the correct function type (#145)

extensions
Alex Beregszaszi 4 years ago committed by GitHub
parent 65ab7617ea
commit cbbec2fe28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -638,7 +638,14 @@ M3Result InitStartFunc (IM3Module io_module)
_ (Compile_Function (function));
}
_ (m3_Call(function));
IM3FuncType ftype = function->funcType;
if (ftype->numArgs != 0 || ftype->returnType != c_m3Type_none)
_throw (m3Err_argumentCountMismatch);
IM3Module module = function->module;
IM3Runtime runtime = module->runtime;
_ ((M3Result) Call (function->compiled, (m3stack_t) runtime->stack, runtime->memory.mallocated, d_m3OpDefaultArgs));
}
_catch: return result;

Loading…
Cancel
Save