summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-05-16 15:01:48 +0000
committerNicholas Clark <nick@ccl4.org>2005-05-16 15:01:48 +0000
commitbce8f4120e2273696708e81ef6c1d919b324fb00 (patch)
tree795ef6d576327f450ec3b57b2d81faeaa9e5c430 /sv.c
parentd26d6e7231f676560b7b29eac7f56fef99b265cb (diff)
downloadperl-bce8f4120e2273696708e81ef6c1d919b324fb00.tar.gz
Assuming that everything with 0x40000000 is SVpad_TYPED is bogus.
p4raw-id: //depot/perl@24480
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 06e23ea5aa..90572f1d43 100644
--- a/sv.c
+++ b/sv.c
@@ -1937,6 +1937,10 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt)
there's no way that it can be safely upgraded, because perl.c
expects to Safefree(SvANY(PL_mess_sv)) */
assert(sv != PL_mess_sv);
+ /* This flag bit is used to mean other things in other scalar types.
+ Given that it only has meaning inside the pad, it shouldn't be set
+ on anything that can get upgraded. */
+ assert((SvFLAGS(sv) & SVpad_TYPED) == 0);
pv = SvPVX(sv);
cur = SvCUR(sv);
len = SvLEN(sv);
@@ -5975,7 +5979,7 @@ Perl_sv_clear(pTHX_ register SV *sv)
if (SvTYPE(sv) >= SVt_PVMG) {
if (SvMAGIC(sv))
mg_free(sv);
- if (SvFLAGS(sv) & SVpad_TYPED)
+ if (SvTYPE(sv) == SVt_PVMG && SvFLAGS(sv) & SVpad_TYPED)
SvREFCNT_dec(SvSTASH(sv));
}
stash = NULL;