summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-09-20 10:20:47 +0000
committerNicholas Clark <nick@ccl4.org>2007-09-20 10:20:47 +0000
commit8265e3d1a493335506aedfbdd58318bf524d0b39 (patch)
tree01440e18fd3b5cec249bff2e6a76ff5dd0b5849d /hv.c
parent73968c7a3e8deb8ff839b220f53356c001f4e89a (diff)
downloadperl-8265e3d1a493335506aedfbdd58318bf524d0b39.tar.gz
assert that what is passed into the hash functions is really an HV.
(MRO code is calling hash functions during global destruction, hence the check on SVTYPEMASK.) p4raw-id: //depot/perl@31922
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hv.c b/hv.c
index f1b3c906f6..a8c48752e6 100644
--- a/hv.c
+++ b/hv.c
@@ -422,6 +422,10 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
if (!hv)
return NULL;
+ if (SvTYPE(hv) == SVTYPEMASK)
+ return NULL;
+
+ assert(SvTYPE(hv) == SVt_PVHV);
if (SvSMAGICAL(hv) && SvGMAGICAL(hv) && !(action & HV_DISABLE_UVAR_XKEY)) {
MAGIC* mg;