Author: Owen Pan Date: 2024-01-27T21:21:01-08:00 New Revision: 179ade6a6d78533179205640dd161bf179daa9ee
URL: https://github.com/llvm/llvm-project/commit/179ade6a6d78533179205640dd161bf179daa9ee DIFF: https://github.com/llvm/llvm-project/commit/179ade6a6d78533179205640dd161bf179daa9ee.diff LOG: [clang-format] Fix an issue reported by static analyzer Fixes #79685. Added: Modified: clang/lib/Format/WhitespaceManager.cpp Removed: ################################################################################ diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp index df84f97a8e8ac1..f9eed7f516bbeb 100644 --- a/clang/lib/Format/WhitespaceManager.cpp +++ b/clang/lib/Format/WhitespaceManager.cpp @@ -1469,7 +1469,7 @@ WhitespaceManager::CellDescriptions WhitespaceManager::getCells(unsigned Start, while (NextNonComment->is(tok::comma)) NextNonComment = NextNonComment->getNextNonComment(); auto j = i; - while (Changes[j].Tok != NextNonComment && j < End) + while (j < End && Changes[j].Tok != NextNonComment) ++j; if (j < End && Changes[j].NewlinesBefore == 0 && Changes[j].Tok->isNot(tok::r_brace)) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits