X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp_hot.c;h=b74000715e19e8752443c8cc07013c3cb06716e3;hb=cccede5366275457276b68bb148b7872098aaf29;hp=e407b7b47748f97681ef24594d6cf962dc0e3cc8;hpb=1de32f2a8367111f29377c6ed81b538f36717dd9;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp_hot.c b/pp_hot.c index e407b7b..b740007 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1859,6 +1859,12 @@ PP(pp_iter) else { sv = AvARRAY(av)[++cx->blk_loop.iterix]; } + if (sv && SvREFCNT(sv) == 0) { + *itersvp = Nullsv; + Perl_croak(aTHX_ + "Use of freed value in iteration (perhaps you modified the iterated array within the loop?)"); + } + if (sv) SvTEMP_off(sv); else