diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-11-22 14:53:47 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-11-23 12:26:41 -0800 |
commit | 4b748257c65d0cf78771db569a081f98eb77c7fa (patch) | |
tree | 9d1e67e08db616b1fae105a0e6d551cc17fb799c /sv.c | |
parent | 38b1111c5f4e6340ce434a21336fe7350c148b03 (diff) | |
download | perl-4b748257c65d0cf78771db569a081f98eb77c7fa.tar.gz |
sv.c:S_curse: remove unnecessary null check
If an SV has the OBJECT flag on but no STASH, it will cause crashes
elsewhere. So there has to be a stash here. I only put the null
check there in 8c34e50dc because I was copying what StashHANDLER
used to do. 8c34e50dc removed the use of StashHANDLER (which calls
gv_handler, which has a null check), replacing it with a different
caching mechanism inlined into S_curse.
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -6332,7 +6332,8 @@ S_curse(pTHX_ SV * const sv, const bool check_refcnt) { dSP; HV* stash; do { - if ((stash = SvSTASH(sv)) && HvNAME(stash)) { + stash = SvSTASH(sv); + if (HvNAME(stash)) { CV* destructor = NULL; assert(SvTYPE(stash) == SVt_PVHV); if (!SvOBJECT(stash)) destructor = (CV *)SvSTASH(stash); |