The bug fixed by change 29610 would have been avoided with this
authorNicholas Clark <nick@ccl4.org>
Thu, 1 Mar 2007 17:46:49 +0000 (17:46 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 1 Mar 2007 17:46:49 +0000 (17:46 +0000)
assertion - ensure that the hek argument to Perl_unshare_hek() is not
NULL, because if it is, then S_unshare_hek_or_pvn() will merrily
unshare the string "" instead.

p4raw-id: //depot/perl@30440

hv.c

diff --git a/hv.c b/hv.c
index cb4eda9..4831ccd 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -2289,6 +2289,7 @@ Perl_unsharepvn(pTHX_ const char *str, I32 len, U32 hash)
 void
 Perl_unshare_hek(pTHX_ HEK *hek)
 {
+    assert(hek);
     unshare_hek_or_pvn(hek, NULL, 0, 0);
 }