From 3d82b713d86b38e66b1dfbee5a7f9cc349a9068c Mon Sep 17 00:00:00 2001 From: "Petter T." Date: Mon, 21 Aug 2023 11:12:01 +0200 Subject: [PATCH] VM Fix erronous wide slot for INDEX_ID1_MATHY_UFUN (bug #64574) Off by one error in slot number check. * libinterp/parse-tree/pt-bytecode-walk.cc: Fix check --- libinterp/parse-tree/pt-bytecode-walk.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libinterp/parse-tree/pt-bytecode-walk.cc b/libinterp/parse-tree/pt-bytecode-walk.cc index 9d5d6391a2..a6f94d2a3a 100644 --- a/libinterp/parse-tree/pt-bytecode-walk.cc +++ b/libinterp/parse-tree/pt-bytecode-walk.cc @@ -4362,9 +4362,9 @@ simple_visit_index_expression (tree_index_expression& expr) // in the end map(unary_mapper_t) will be called while executing, // unless the user have overriden those. // We do a special opcode for those to speed them up. - // Don't do the special opcode if it would need wide slots, i.e. slot nr > 256. + // Don't do the special opcode if it would need wide slots, i.e. slot nr >= 256. auto umaped_fn_it = m_name_to_unary_func.find (id_name); - if (!args || args->size () != 1 || umaped_fn_it == m_name_to_unary_func.end () || slot > 256) + if (!args || args->size () != 1 || umaped_fn_it == m_name_to_unary_func.end () || slot >= 256) { MAYBE_PUSH_WIDE_OPEXT (slot); PUSH_CODE (INSTR::INDEX_ID_NARGOUT1);