This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
avoid coredump on C<sort { my $c; return $a cmp $b } ...>
authorGurusamy Sarathy <gsar@cpan.org>
Wed, 20 Oct 1999 23:45:03 +0000 (23:45 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Wed, 20 Oct 1999 23:45:03 +0000 (23:45 +0000)
p4raw-id: //depot/perl@4417

op.c

diff --git a/op.c b/op.c
index 64d801f..f38b26c 100644 (file)
--- a/op.c
+++ b/op.c
@@ -6187,7 +6187,7 @@ Perl_peep(pTHX_ register OP *o)
            break;
 
        case OP_RETURN:
-           if (o->op_next->op_type != OP_LEAVESUBLV) {
+           if (o->op_next && o->op_next->op_type != OP_LEAVESUBLV) {
                o->op_seq = PL_op_seqmax++;
                break;
            }