summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-10-07 15:38:56 +0100
committerDavid Mitchell <davem@iabyn.com>2011-10-07 20:07:48 +0100
commit9a214eecd07ed44274740f81d8dce0e526badf80 (patch)
tree1e33a4db9f23d13f72f267978a83a39188677a11 /scope.c
parentd0c0e7dd0ccf3d5c2f658529d3ee578a0bcb116e (diff)
downloadperl-9a214eecd07ed44274740f81d8dce0e526badf80.tar.gz
make SVs_PADTMP and SVs_PADSTALE share a bit
SVs_PADSTALE is only meaningful with SVs_PADMY, while SVs_PADTMP is only meaningful with !SVs_PADMY, so let them share the same flag bit. Note that this doesn't yet free a bit in SvFLAGS, as the two bits are also used for SVpad_STATE, SVpad_TYPED. (This is is follow-on to 62bb6514085e5eddc42b4fdaf3713ccdb7f1da85.)
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/scope.c b/scope.c
index 9ed6475d6c..14664a26c5 100644
--- a/scope.c
+++ b/scope.c
@@ -922,7 +922,8 @@ Perl_leave_scope(pTHX_ I32 base)
SvPADSTALE_on(sv); /* mark as no longer live */
}
else { /* Someone has a claim on this, so abandon it. */
- const U32 padflags = SvFLAGS(sv) & (SVs_PADMY|SVs_PADTMP);
+ assert( SvFLAGS(sv) & SVs_PADMY);
+ assert(!(SvFLAGS(sv) & SVs_PADTMP));
switch (SvTYPE(sv)) { /* Console ourselves with a new value */
case SVt_PVAV: *(SV**)ptr = MUTABLE_SV(newAV()); break;
case SVt_PVHV: *(SV**)ptr = MUTABLE_SV(newHV()); break;
@@ -931,7 +932,7 @@ Perl_leave_scope(pTHX_ I32 base)
SvREFCNT_dec(sv); /* Cast current value to the winds. */
/* preserve pad nature, but also mark as not live
* for any closure capturing */
- SvFLAGS(*(SV**)ptr) |= padflags | SVs_PADSTALE;
+ SvFLAGS(*(SV**)ptr) |= (SVs_PADMY|SVs_PADSTALE);
}
break;
case SAVEt_DELETE: