[clang-tools-extra] 6fe20a4 - [clangd] Fix yet-another gratuitous llvm::Error crash

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Sun May 3 13:14:07 PDT 2020


Author: Sam McCall
Date: 2020-05-03T22:13:58+02:00
New Revision: 6fe20a44fd3fc95198b3b38dc1080266be4ef004

URL: https://github.com/llvm/llvm-project/commit/6fe20a44fd3fc95198b3b38dc1080266be4ef004
DIFF: https://github.com/llvm/llvm-project/commit/6fe20a44fd3fc95198b3b38dc1080266be4ef004.diff

LOG: [clangd] Fix yet-another gratuitous llvm::Error crash

Added: 
    

Modified: 
    clang-tools-extra/clangd/SourceCode.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/SourceCode.cpp b/clang-tools-extra/clangd/SourceCode.cpp
index d50968bae19b..0d08bf8e0a1a 100644
--- a/clang-tools-extra/clangd/SourceCode.cpp
+++ b/clang-tools-extra/clangd/SourceCode.cpp
@@ -564,7 +564,7 @@ format::FormatStyle getFormatStyleForFile(llvm::StringRef File,
   if (!Style) {
     log("getStyle() failed for file {0}: {1}. Fallback is LLVM style.", File,
         Style.takeError());
-    Style = format::getLLVMStyle();
+    return format::getLLVMStyle();
   }
   return *Style;
 }


        


More information about the cfe-commits mailing list