From: Steve Hancock Date: Tue, 5 Apr 2022 13:18:15 +0000 (-0700) Subject: Fix unusual instability, issue b1333 X-Git-Tag: 20220217.03~19 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=45da95ab131ff765dcaa1f4f436ef8bacde162d2;p=perltidy.git Fix unusual instability, issue b1333 --- diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index d1c33ae0..e44e3269 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -9643,6 +9643,27 @@ WriteMakefile( --indent-columns=1 --square-bracket-vertical-tightness-closing=1 +==> b1333.in <== +# S1 + $_[ + HEAP + + ]->{postback_tests}->{$test_number} + = + + "ok $test_number\n"; + +# S2 + $_[ + HEAP + + ]->{postback_tests}->{$test_number} = + + "ok $test_number\n"; + +==> b1333.par <== +--break-before-all-operators + ==> b140.in <== $cmd[ $i ]=[ $s, $e, $cmd, \@hunk, $i ] ; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 98f88196..61f166cd 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -19570,9 +19570,12 @@ EOM # This is complex ($total_depth_variation=6): # $res2 = # (is_boundp("a", 'self-insert') && is_boundp("b", 'self-insert')); + + # The check ($i_old_.. < $max_index_to_go) was added to fix b1333 elsif ($i_old_assignment_break && $total_depth_variation > 4 - && $old_breakpoint_count == 1 ) + && $old_breakpoint_count == 1 + && $i_old_assignment_break < $max_index_to_go ) { $saw_good_breakpoint = 1; } ## end elsif ( $i_old_assignment_break...)