This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Comment that this "optimisation" is actually a necessary fixup.
authorNicholas Clark <nick@ccl4.org>
Fri, 31 Oct 2003 18:54:26 +0000 (18:54 +0000)
committerNicholas Clark <nick@ccl4.org>
Fri, 31 Oct 2003 18:54:26 +0000 (18:54 +0000)
When the split occurs (to make the opti{miser,onal}) this isn't
(Richard Clamp reminded me that I forgot to do this)

p4raw-id: //depot/perl@21586

op.c

diff --git a/op.c b/op.c
index 6beeae0..04df4de 100644 (file)
--- a/op.c
+++ b/op.c
@@ -6277,6 +6277,10 @@ Perl_peep(pTHX_ register OP *o)
            o->op_seq = PL_op_seqmax++;
            break;
        case OP_STUB:
+           /* XXX This makes sub {}; work as expected.
+              ie {return;} not {return @_;}
+              When optimiser is properly split into fixups and
+              optimisations, this needs to stay in the fixups.  */
            if(!oldop &&
               o->op_next &&
               o->op_next->op_type == OP_LEAVESUB) {