summaryrefslogtreecommitdiff
path: root/scope.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-09-08 16:53:10 +0100
committerDavid Mitchell <davem@iabyn.com>2010-09-08 16:53:10 +0100
commitf83b46a0147ba6f476add85d17f61a7e7fb00f21 (patch)
tree0dcc25c8bf4f78496319fc13634d851282f3a960 /scope.h
parentaafca5257dfefe4cf2a531c79cadea21a566f9c3 (diff)
downloadperl-f83b46a0147ba6f476add85d17f61a7e7fb00f21.tar.gz
bad things happened with for $x (...) { *x = *y }
fix for [perl #21469]: since the GP may be pulled from under us and freed, coredumps and strange things can happen. Fix this by storing a pointer to the GV in the loop block, rather than a pointer to the GvSV slot. The ITHREADS variant already stores GV rather than than &GvSV; extend this to non-threaded builds too. Also, for both threaded and non-threaded, it used to push &GvSV on the save stack. Fix this by introducing a new save type, SAVEt_GVSV. This behaves similarly to SAVEt_SV, but without magic get/set. This means that for $package_var (...) is now close in behaviour to local $package_var = ... (except for the magic bit).
Diffstat (limited to 'scope.h')
-rw-r--r--scope.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/scope.h b/scope.h
index 7df44b6471..6cef09162e 100644
--- a/scope.h
+++ b/scope.h
@@ -57,6 +57,7 @@
#define SAVEt_ADELETE 46
#define SAVEt_I32_SMALL 47
#define SAVEt_INT_SMALL 48
+#define SAVEt_GVSV 49
#define SAVEf_SETMAGIC 1
#define SAVEf_KEEPOLDELEM 2