diff options
author | Owen Pan <owenpiano@gmail.com> | 2023-09-24 17:53:05 -0700 |
---|---|---|
committer | Owen Pan <owenpiano@gmail.com> | 2023-09-24 17:53:05 -0700 |
commit | ff7e85402280516808669d11508c1ba3dac7d785 (patch) | |
tree | 64a15aabc467983138cdf27b1b7e79f741bc5aa3 /clang/lib/Format/WhitespaceManager.cpp | |
parent | 2c3cae3f01b10a2ba3745761e11b63a2b129eee9 (diff) | |
download | llvm-ff7e85402280516808669d11508c1ba3dac7d785.zip llvm-ff7e85402280516808669d11508c1ba3dac7d785.tar.gz llvm-ff7e85402280516808669d11508c1ba3dac7d785.tar.bz2 |
[clang-format] Fix an assertion failure in Whitespace Manager
Diffstat (limited to 'clang/lib/Format/WhitespaceManager.cpp')
-rw-r--r-- | clang/lib/Format/WhitespaceManager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp index d7e5612..27ad90c 100644 --- a/clang/lib/Format/WhitespaceManager.cpp +++ b/clang/lib/Format/WhitespaceManager.cpp @@ -1088,9 +1088,9 @@ void WhitespaceManager::alignTrailingComments() { else ChangeMaxColumn = ChangeMinColumn; - if (I + 1 < Size && Changes[I + 1].ContinuesPPDirective) { + if (I + 1 < Size && Changes[I + 1].ContinuesPPDirective && + ChangeMaxColumn >= 2) { ChangeMaxColumn -= 2; - assert(ChangeMaxColumn >= 0); } bool WasAlignedWithStartOfNextLine = false; |