This revision was automatically updated to reflect the committed changes.
Closed by commit rGad7211df6f25 (authored by obruns, committed by teemperor).

Changed prior to commit:
  https://reviews.llvm.org/D77468?vs=255059&id=255256#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77468/new/

https://reviews.llvm.org/D77468

Files:
  clang/lib/AST/RawCommentList.cpp


Index: clang/lib/AST/RawCommentList.cpp
===================================================================
--- clang/lib/AST/RawCommentList.cpp
+++ clang/lib/AST/RawCommentList.cpp
@@ -431,7 +431,7 @@
   };
 
   auto DropTrailingNewLines = [](std::string &Str) {
-    while (Str.back() == '\n')
+    while (!Str.empty() && Str.back() == '\n')
       Str.pop_back();
   };
 


Index: clang/lib/AST/RawCommentList.cpp
===================================================================
--- clang/lib/AST/RawCommentList.cpp
+++ clang/lib/AST/RawCommentList.cpp
@@ -431,7 +431,7 @@
   };
 
   auto DropTrailingNewLines = [](std::string &Str) {
-    while (Str.back() == '\n')
+    while (!Str.empty() && Str.back() == '\n')
       Str.pop_back();
   };
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to