Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 0847e74

Browse files
author
Reini Urban
committed
mderef_u: fix MDEREF_INDEX_uoob run-time
we have a switch, which needs a static value. uoob is currently only possible with const. any :const padsv is converted to const before already. this passes now all tests, but we still wrongly convert a aelemfast_lex_u to mderef, the maybe_aelemfast logic is flawed.
1 parent 3ef3aad commit 0847e74

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

op.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14327,12 +14327,14 @@ S_maybe_multideref(pTHX_ OP *start, OP *orig_o, UV orig_action, U8 hints)
1432714327
DEBUG_kv(Perl_deb(aTHX_
1432814328
"mderef %s[%"IVdf"] shape ok -> uoob\n",
1432914329
PAD_COMPNAME_PV(targ), arg->iv));
14330+
#if 0 /* already done in ck_aelem */
1433014331
if (arg->iv < 0) {
1433114332
arg->iv = AvFILLp(av)+1+arg->iv;
1433214333
DEBUG_kv(Perl_deb(aTHX_
1433314334
"mderef %s[->%"IVdf"]\n",
1433414335
PAD_COMPNAME_PV(targ), arg->iv));
1433514336
}
14337+
#endif
1433614338
}
1433714339
index_type |= MDEREF_INDEX_uoob;
1433814340
}

pp_hot.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,6 +2418,7 @@ PP(pp_multideref)
24182418
switch (actions & MDEREF_INDEX_MASK) {
24192419
case MDEREF_INDEX_none:
24202420
goto finish;
2421+
case MDEREF_INDEX_const|MDEREF_INDEX_uoob:
24212422
case MDEREF_INDEX_const:
24222423
elem = (++items)->iv;
24232424
break;

0 commit comments

Comments
 (0)