[patch] peep() is rude
Hugo van der Sanden [Tue, 8 Jan 2002 19:17:50 +0000 (19:17 +0000)]
Message-Id: <200201081917.g08JHoW15789@crypt.compulink.co.uk>

p4raw-id: //depot/perl@14139

op.c
t/run/kill_perl.t

diff --git a/op.c b/op.c
index e4f84fa..c97dacd 100644 (file)
--- a/op.c
+++ b/op.c
@@ -7035,7 +7035,7 @@ Perl_peep(pTHX_ register OP *o)
            else if (o->op_next->op_type == OP_RV2AV) {
                OP* pop = o->op_next->op_next;
                IV i;
-               if (pop->op_type == OP_CONST &&
+               if (pop && pop->op_type == OP_CONST &&
                    (PL_op = pop->op_next) &&
                    pop->op_next->op_type == OP_AELEM &&
                    !(pop->op_next->op_private &
index e568afe..c2eb01f 100644 (file)
@@ -816,3 +816,9 @@ ok
 print "ok" if 'X' =~ /\X/;
 EXPECT
 ok
+######## segfault in 5.6.1 within peep()
+@a = (1..9);
+@b = sort { @c = sort { @d = sort { 0 } @a; @d; } @a; } @a;
+print join '', @a, "\n";
+EXPECT
+123456789