diff options
author | Owen Pan <owenpiano@gmail.com> | 2024-03-24 15:22:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-24 15:22:40 -0700 |
commit | cceedc939a43c7c732a5888364251775bffc2dba (patch) | |
tree | cae065ab29e4e5e01f0716ce700d0ce1148dd30b /clang/lib/Format/WhitespaceManager.cpp | |
parent | 67f2267ae006f35edfdf36567646403e61527d1b (diff) | |
download | llvm-cceedc939a43c7c732a5888364251775bffc2dba.zip llvm-cceedc939a43c7c732a5888364251775bffc2dba.tar.gz llvm-cceedc939a43c7c732a5888364251775bffc2dba.tar.bz2 |
[clang-format] Fix a crash with AlignArrayOfStructures option (#86420)
Fixes #86109.
Diffstat (limited to 'clang/lib/Format/WhitespaceManager.cpp')
-rw-r--r-- | clang/lib/Format/WhitespaceManager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp index fef85ab..710bf8d 100644 --- a/clang/lib/Format/WhitespaceManager.cpp +++ b/clang/lib/Format/WhitespaceManager.cpp @@ -1491,7 +1491,7 @@ WhitespaceManager::CellDescriptions WhitespaceManager::getCells(unsigned Start, : Cell); // Go to the next non-comment and ensure there is a break in front const auto *NextNonComment = C.Tok->getNextNonComment(); - while (NextNonComment->is(tok::comma)) + while (NextNonComment && NextNonComment->is(tok::comma)) NextNonComment = NextNonComment->getNextNonComment(); auto j = i; while (j < End && Changes[j].Tok != NextNonComment) |