[perl #51636] segmentation fault with array ties
blino@mandriva.com [Wed, 12 Mar 2008 02:59:45 +0000 (19:59 -0700)]
From: blino@mandriva.com (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-25460-1205315984-377.51636-75-0@perl.org>

p4raw-id: //depot/perl@33495

av.c

diff --git a/av.c b/av.c
index e6c26bc..67ffad9 100644 (file)
--- a/av.c
+++ b/av.c
@@ -437,7 +437,7 @@ Perl_av_clear(pTHX_ register AV *av)
     /* Give any tie a chance to cleanup first */
     if (SvRMAGICAL(av)) {
        const MAGIC* const mg = SvMAGIC(av);
-       if (PL_delaymagic && mg->mg_type == PERL_MAGIC_isa)
+       if (PL_delaymagic && mg && mg->mg_type == PERL_MAGIC_isa)
            PL_delaymagic |= DM_ARRAY;
         else
            mg_clear((SV*)av);