From: Steve Hancock Date: Mon, 28 Mar 2022 00:50:03 +0000 (-0700) Subject: fix minor initialization error, issue c131 X-Git-Tag: 20220217.03~28 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1645a14677bb3b02ed076034d79208aa6798e878;p=perltidy.git fix minor initialization error, issue c131 --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index e41de5bb..c6dde728 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -18253,9 +18253,25 @@ sub break_long_lines { # prevent following the old breakpoints with the # -iob flag. my ( $self, $dd, $rcomma_bias_to_go ) = @_; + + # Check added for issue c131; an error here would be due to an + # error initializing @comma_index when entering depth $dd. + if (DEVEL_MODE) { + foreach my $ii ( @{ $comma_index[$dd] } ) { + if ( $ii < 0 || $ii > $max_index_to_go ) { + my $KK = $K_to_go[0]; + my $lno = $self->[_rLL_]->[$KK]->[_LINE_INDEX_]; + Fault(<[$ii] = $bias; @@ -18777,6 +18793,7 @@ EOM $index_before_arrow[$depth] = -1; $interrupted_list[$depth] = 0; $item_count_stack[$depth] = 0; + $comma_index[$depth] = undef; $last_comma_index[$depth] = undef; $last_dot_index[$depth] = undef; $last_nonblank_type[$depth] = $last_nonblank_type;