Skip to content

Commit 59a6ea0

Browse files
committed
comment
1 parent 3f82d66 commit 59a6ea0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

clang/lib/Format/WhitespaceManager.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,11 @@ WhitespaceManager::CellDescriptions WhitespaceManager::getCells(unsigned Start,
14571457
Cells.push_back(CellDescription{i, ++Cell, i + 1, false, nullptr});
14581458
CellCounts.push_back(
14591459
C.Tok->Previous->isNot(tok::comma) &&
1460-
!MatchingParen->MatchingParen->Previous->is(tok::equal)
1460+
// When dealing with C array designators. There is a
1461+
// possibility of some nested array not having an `=`.
1462+
// When this happens we make the cells non retangular,
1463+
// avoiding an access out of bound later on.
1464+
MatchingParen->MatchingParen->Previous->isNot(tok::equal)
14611465
? Cell + 1
14621466
: Cell);
14631467
// Go to the next non-comment and ensure there is a break in front

0 commit comments

Comments
 (0)