]> git.donarmstrong.com Git - perltidy.git/commitdiff
Fix unusual instability, issue b1333
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 5 Apr 2022 13:18:15 +0000 (06:18 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 5 Apr 2022 13:18:15 +0000 (06:18 -0700)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Formatter.pm

index d1c33ae058899bdf860cda9529a2399bbd503780..e44e326969941fd34a445f34e63d3b6be3ccf724 100644 (file)
@@ -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 ] ;
index 98f881960ef8ecc6ad5ecbb9c186e4081e19701f..61f166cdb1e312f17fede940f955801c2ed899b5 100644 (file)
@@ -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...)