Skip to content

Commit 91976df

Browse files
authored
fix: builtin_call_indirect does not manage GC obj correctly (#2924)
1 parent a6de4c3 commit 91976df

File tree

5 files changed

+4527
-0
lines changed

5 files changed

+4527
-0
lines changed

src/builtins.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3653,6 +3653,9 @@ function builtin_call_indirect(ctx: BuiltinFunctionContext): ExpressionRef {
36533653
let paramTypeRefs = new Array<TypeRef>(numOperands);
36543654
for (let i = 0; i < numOperands; ++i) {
36553655
operandExprs[i] = compiler.compileExpression(operands[1 + i], Type.auto);
3656+
if (compiler.currentType.isManaged) {
3657+
operandExprs[i] = module.tostack(operandExprs[i]);
3658+
}
36563659
paramTypeRefs[i] = compiler.currentType.toRef();
36573660
}
36583661
compiler.currentType = returnType;

0 commit comments

Comments
 (0)