From: Steve Hancock Date: Sat, 5 Sep 2020 03:58:28 +0000 (-0700) Subject: fixed minor undefined variable problem X-Git-Tag: 20200907~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c5956cd3a68f82fe298e7410c9e4cef39f3c4b52;p=perltidy.git fixed minor undefined variable problem --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index dc11a18e..f9fde7a3 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -14853,6 +14853,13 @@ sub pad_array_to_go { # we are breaking after an opening brace, paren, # so don't break before it too && $i_start_2 ne $i_opening + + # Defensive coding check: be sure the index is valid. + # FIXME: We should probably be using K indexes for 'starting_index' + # so that the object can remain valid between batches. + # See test problem: random_issues/random_487.pro + && $i_start_2 >= 0 + && $i_start_2 <= $max_index_to_go ) {