Skip to content

Commit c7a6bcf

Browse files
committed
Merge pull request #1714 from pguyot/w24/add-missing-reduction-decrement-in-call-fun2
Add missing reduction decrement in OP_CALL_FUN2 These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 425e02a + 95b2b99 commit c7a6bcf

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)