From: Nicholas Clark Date: Thu, 20 Sep 2007 10:20:47 +0000 (+0000) Subject: assert that what is passed into the hash functions is really an HV. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8265e3d1a493335506aedfbdd58318bf524d0b39;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/hv.c b/hv.c index f1b3c90..a8c4875 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;