diff options
author | David Mitchell <davem@iabyn.com> | 2014-03-06 13:32:56 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2014-03-16 18:34:37 +0000 |
commit | cdec98ff86310d40c5a05f14e7e624f52ddcc156 (patch) | |
tree | f678e339c5e4aa96c02a321cadc525cadcb135a6 /op.c | |
parent | 932bca295d64243e2ef2aeaacc779b68cc05e1b2 (diff) | |
download | perl-cdec98ff86310d40c5a05f14e7e624f52ddcc156.tar.gz |
code following eval {} not always optimised
In something like this
eval { 1 while 1 };
$x = $a[0];
The optimising of the while loop makes Perl_rpeep() miss processing the
chain of ops from the OP_LEAVETRY onwards. So in the code above for
example, the alem wont be optimised into an alemfast.
Fix this by explicitly recursing into the entertry->op_other branch
(which actually points at the leavetry).
The infinite loop above can be broken by, for example, a signal handler
calling die.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -11884,6 +11884,11 @@ Perl_rpeep(pTHX_ OP *o) DEFER(cLOOP->op_lastop); break; + case OP_ENTERTRY: + assert(cLOGOPo->op_other->op_type == OP_LEAVETRY); + DEFER(cLOGOPo->op_other); + break; + case OP_SUBST: assert(!(cPMOP->op_pmflags & PMf_ONCE)); while (cPMOP->op_pmstashstartu.op_pmreplstart && |