summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-22 14:53:47 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-11-23 12:26:41 -0800
commit4b748257c65d0cf78771db569a081f98eb77c7fa (patch)
tree9d1e67e08db616b1fae105a0e6d551cc17fb799c /sv.c
parent38b1111c5f4e6340ce434a21336fe7350c148b03 (diff)
downloadperl-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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 5ecfbeb50b..9aa2224c42 100644
--- a/sv.c
+++ b/sv.c
@@ -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);