Skip to content

Commit

Permalink
VM Fix erronous wide slot for INDEX_ID1_MATHY_UFUN (bug #64574)
Browse files Browse the repository at this point in the history
Off by one error in slot number check.

* libinterp/parse-tree/pt-bytecode-walk.cc: Fix check
  • Loading branch information
Petter T. committed Aug 21, 2023
1 parent 98252b0 commit 3d82b71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libinterp/parse-tree/pt-bytecode-walk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3d82b71

Please sign in to comment.