Skip to content

Commit 2945af6

Browse files
committed
Don't reset nested unchecked contexts, fixes #515
1 parent ed97672 commit 2945af6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/builtins.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2936,9 +2936,10 @@ export function compileCall(
29362936
return module.createUnreachable();
29372937
}
29382938
let flow = compiler.currentFlow;
2939+
let alreadyUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT);
29392940
flow.set(FlowFlags.UNCHECKED_CONTEXT);
29402941
ret = compiler.compileExpressionRetainType(operands[0], contextualType, WrapMode.NONE);
2941-
flow.unset(FlowFlags.UNCHECKED_CONTEXT);
2942+
if (!alreadyUnchecked) flow.unset(FlowFlags.UNCHECKED_CONTEXT);
29422943
return ret;
29432944
}
29442945
case BuiltinSymbols.call_indirect: { // call_indirect<T?>(target: Function | u32, ...args: *[]) -> T

0 commit comments

Comments
 (0)