# HG changeset patch # User Petter T. # Date 1692609121 -7200 # Mon Aug 21 11:12:01 2023 +0200 # Node ID ae36a399c5fb5dbf1ca9701c2aa5f43075978237 # Parent dc67a4ea04605c56248560d81902124fe3f1813f 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 diff -r dc67a4ea0460 -r ae36a399c5fb libinterp/parse-tree/pt-bytecode-walk.cc --- a/libinterp/parse-tree/pt-bytecode-walk.cc Sat Aug 19 11:25:42 2023 +0200 +++ b/libinterp/parse-tree/pt-bytecode-walk.cc Mon Aug 21 11:12:01 2023 +0200 @@ -4362,9 +4362,9 @@ // 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);