Skip to content

Commit 95b2b99

Browse files
committed
opcodeswitch: add missing reduction decrement in OP_CALL_FUN2
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
1 parent 425e02a commit 95b2b99

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libAtomVM/opcodesswitch.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6807,6 +6807,12 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
68076807
}
68086808

68096809
case OP_CALL_FUN2: {
6810+
#ifdef IMPL_EXECUTE_LOOP
6811+
remaining_reductions--;
6812+
if (UNLIKELY(!remaining_reductions)) {
6813+
SCHEDULE_NEXT(mod, pc - 1);
6814+
}
6815+
#endif
68106816
term tag;
68116817
DECODE_COMPACT_TERM(tag, pc)
68126818
unsigned int args_count;

0 commit comments

Comments
 (0)