$x = $empty_hash{$undef_val} doesn't give a warning
Dave Mitchell [Tue, 27 May 2003 19:31:10 +0000 (20:31 +0100)]
Message-ID: <20030527183110.GA22715@fdgroup.com>

p4raw-id: //depot/perl@19632

hv.c

diff --git a/hv.c b/hv.c
index 52c6aef..ee08ce4 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -418,6 +418,7 @@ Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, register U32 hash)
 #endif
     }
 
+    keysave = key = SvPV(keysv, klen);
     xhv = (XPVHV*)SvANY(hv);
     if (!xhv->xhv_array /* !HvARRAY(hv) */) {
        if (lval
@@ -432,7 +433,6 @@ Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, register U32 hash)
            return 0;
     }
 
-    keysave = key = SvPV(keysv, klen);
     is_utf8 = (SvUTF8(keysv)!=0);
 
     if (is_utf8) {