Skip to content

Commit b147b31

Browse files
committed
Merge pull request atomvm#508 from pguyot/w16/fix-alloc-in-OP_BS_GET_INTEGER2
Add missing boxed integer allocation in `OP_BS_GET_INTEGER2` This bug could potentially yield a crash with current memory implementation, however it was not observed. 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 4244c15 + c1f7cd0 commit b147b31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libAtomVM/opcodesswitch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4757,9 +4757,9 @@ static bool maybe_call_native(Context *ctx, AtomString module_name, AtomString f
47574757
} else {
47584758
term_set_match_state_offset(src, bs_offset + increment);
47594759

4760-
term t = term_make_maybe_boxed_int64(ctx, value.s);
4760+
term t = maybe_alloc_boxed_integer_fragment(ctx, value.s);
47614761
if (UNLIKELY(term_is_invalid_term(t))) {
4762-
RAISE_ERROR(OUT_OF_MEMORY_ATOM);
4762+
HANDLE_ERROR();
47634763
}
47644764

47654765
WRITE_REGISTER(dreg_type, dreg, t);

0 commit comments

Comments
 (0)