diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-09-20 10:20:47 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-09-20 10:20:47 +0000 |
commit | 8265e3d1a493335506aedfbdd58318bf524d0b39 (patch) | |
tree | 01440e18fd3b5cec249bff2e6a76ff5dd0b5849d /hv.c | |
parent | 73968c7a3e8deb8ff839b220f53356c001f4e89a (diff) | |
download | perl-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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |