assert that HvARRAY is NULL when freeing an HV
authorDavid Mitchell <davem@iabyn.com>
Tue, 3 May 2011 16:10:46 +0000 (17:10 +0100)
committerDavid Mitchell <davem@iabyn.com>
Thu, 19 May 2011 13:49:43 +0000 (14:49 +0100)
The code path that leads to HvAUX being empty and thus HvARRAY being
freed, is non-obvious: so put in an assert against any future failure.

sv.c

diff --git a/sv.c b/sv.c
index 7ce4b6d..534638c 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -6102,6 +6102,7 @@ Perl_sv_clear(pTHX_ SV *const orig_sv)
                PL_last_swash_hv = NULL;
            }
            Perl_hv_undef_flags(aTHX_ MUTABLE_HV(sv), HV_NAME_SETALL);
+           assert(!HvARRAY((HV*)sv));
            break;
        case SVt_PVAV:
            {