changeset 32274:a32650514d38

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
author Petter T.
date Mon, 21 Aug 2023 11:12:01 +0200
parents 2779eb2ecb74
children 66d977e17588
files libinterp/parse-tree/pt-bytecode-walk.cc
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);