Skip to content

Commit 4f563ac

Browse files
committed
Merge pull request #1696 from pguyot/w24/simplify-test_arity-2
Simplify test_arity/2 as it assumes arg is a tuple 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 cc4273c + 7fd4b71 commit 4f563ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libAtomVM/opcodesswitch.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3172,7 +3172,8 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
31723172
#ifdef IMPL_EXECUTE_LOOP
31733173
TRACE("test_arity/2, label=%i, arg1=%lx\n", label, arg1);
31743174

3175-
if (!(term_is_tuple(arg1) && (uint32_t) term_get_tuple_arity(arg1) == arity)) {
3175+
assert(term_is_tuple(arg1));
3176+
if ((uint32_t) term_get_tuple_arity(arg1) != arity) {
31763177
pc = mod->labels[label];
31773178
}
31783179
#endif

0 commit comments

Comments
 (0)