In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/5aa240eab7dbaa91f98c2fee1f04b6c0b5a9b9e3?hp=62d9081044ad53db012f71dbc7a968127804d169>
- Log ----------------------------------------------------------------- commit 5aa240eab7dbaa91f98c2fee1f04b6c0b5a9b9e3 Author: David Mitchell <[email protected]> Date: Mon Dec 5 14:54:44 2016 +0000 assertion failure in ... or ((0) x 0)) [perl #130247] Perl_rpeep(OP *): Assertion `oldop' failed the 'x 0' optimising code in rpeep didn't expect the repeat expression to occur on the op_other side of an op_next chain. ----------------------------------------------------------------------- Summary of changes: op.c | 4 ++-- t/op/repeat.t | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/op.c b/op.c index f8df8b4ef6..722ee358c6 100644 --- a/op.c +++ b/op.c @@ -13825,10 +13825,10 @@ Perl_rpeep(pTHX_ OP *o) && kid->op_next->op_type == OP_REPEAT && kid->op_next->op_private & OPpREPEAT_DOLIST && (kid->op_next->op_flags & OPf_WANT) == OPf_WANT_LIST - && SvIOK(kSVOP_sv) && SvIVX(kSVOP_sv) == 0) + && SvIOK(kSVOP_sv) && SvIVX(kSVOP_sv) == 0 + && oldop) { o = kid->op_next; /* repeat */ - assert(oldop); oldop->op_next = o; op_free(cBINOPo->op_first); op_free(cBINOPo->op_last ); diff --git a/t/op/repeat.t b/t/op/repeat.t index d21bdb3e48..978916689b 100644 --- a/t/op/repeat.t +++ b/t/op/repeat.t @@ -6,7 +6,7 @@ BEGIN { set_up_inc( '../lib' ); } -plan(tests => 48); +plan(tests => 49); # compile time @@ -183,3 +183,12 @@ fresh_perl_like( { }, '(1) x ~1', ); + +# [perl #130247] Perl_rpeep(OP *): Assertion `oldop' failed +# +# the 'x 0' optimising code in rpeep didn't expect the repeat expression +# to occur on the op_other side of an op_next chain. +# This used to give an assertion failure + +eval q{() = (() or ((0) x 0)); 1}; +is($@, "", "RT #130247"); -- Perl5 Master Repository
