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

Commit f5815ac

Browse files
author
Reini Urban
committed
mderef_u: check all 3 MAGIC at run-time
loop oob optimizations also work on magic arrays. See check for GMG also, and fall back to av_fetch. Closes #190
1 parent 85027b2 commit f5815ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pp_hot.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2449,7 +2449,8 @@ PP(pp_multideref)
24492449
/* this is basically a copy of pp_aelem with OPpDEREF skipped */
24502450

24512451
if (!(actions & MDEREF_FLAG_last)) {
2452-
if (UNLIKELY((actions & MDEREF_INDEX_uoob) && !SvRMAGICAL(sv))) {
2452+
/* loop oob allow magic arrays */
2453+
if (UNLIKELY((actions & MDEREF_INDEX_uoob) && !SvMAGICAL(sv))) {
24532454
SV* av = sv;
24542455
DEBUG_kv(Perl_deb(aTHX_ "mderef oob [%ld]\n", elem));
24552456
sv = AvARRAY(av)[elem];

0 commit comments

Comments
 (0)