diff --git a/peep.c b/peep.c index 68da56f3bf13..e9de45eb0a68 100644 --- a/peep.c +++ b/peep.c @@ -3988,7 +3988,7 @@ Perl_rpeep(pTHX_ OP *o) */ OP *left = OpSIBLING(right); if (left->op_type == OP_SUBSTR - && (left->op_private & 7) < 4) { + && (cMAXARG3x(left) < 4)) { op_null(o); /* cut out right */ op_sibling_splice(o, NULL, 1, NULL); diff --git a/pp.c b/pp.c index cd4550c0d768..43513c3a7a53 100644 --- a/pp.c +++ b/pp.c @@ -3575,7 +3575,7 @@ Perl_translate_substr_offsets( STRLEN curlen, IV pos1_iv, } PP_wrapped(pp_substr, - (PL_op->op_private & 7) + MAXARG3 + ((PL_op->op_private & OPpSUBSTR_REPL_FIRST) ? 1 : 0), 0) { @@ -3595,7 +3595,7 @@ PP_wrapped(pp_substr, SV *repl_sv = NULL; const char *repl = NULL; STRLEN repl_len; - int num_args = PL_op->op_private & 7; + int num_args = MAXARG3; bool repl_need_utf8_upgrade = FALSE; if (num_args > 2) {