summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2003-04-21 14:19:50 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-04-23 19:11:01 +0000
commitcccede5366275457276b68bb148b7872098aaf29 (patch)
treedfb369913110eaa12ba8081f848043cf051b63b5 /pp_hot.c
parent1de32f2a8367111f29377c6ed81b538f36717dd9 (diff)
downloadperl-cccede5366275457276b68bb148b7872098aaf29.tar.gz
A new fatal error :
Subject: [PATCH] Perl_croak("Use of freed value in iteration") Message-ID: <20030421121950.GB18189@fdgroup.com> Message-ID: <20030421125433.GC18189@fdgroup.com> p4raw-id: //depot/perl@19316
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pp_hot.c b/pp_hot.c
index e407b7b477..b74000715e 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