summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgs@consttype.org>2014-02-19 15:41:51 +0100
committerRafael Garcia-Suarez <rgs@consttype.org>2014-02-19 15:42:18 +0100
commit8a50cd03a18f63853c30d77231f3eed37cdf7efa (patch)
treed6258e0e1b02b4ebd31707e5a6e5ebfcdeb03549 /hv.c
parentb79bb8373d09257612fa6517489b425bf5c77fcb (diff)
downloadperl-8a50cd03a18f63853c30d77231f3eed37cdf7efa.tar.gz
Do not dereference hv before ensuring it's not NULL
This should fix RT #116441 and possibly other bugs.
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hv.c b/hv.c
index 1d322fe599..a9322aac87 100644
--- a/hv.c
+++ b/hv.c
@@ -1753,10 +1753,11 @@ Perl_hv_undef_flags(pTHX_ HV *hv, U32 flags)
{
dVAR;
XPVHV* xhv;
- const bool save = !!SvREFCNT(hv);
+ bool save;
if (!hv)
return;
+ save = !!SvREFCNT(hv);
DEBUG_A(Perl_hv_assert(aTHX_ hv));
xhv = (XPVHV*)SvANY(hv);