]> granicus.if.org Git - clang/commitdiff
Remember that FixItOptions* is optional and don't crash when it's not provided.
authorNick Lewycky <nicholas@mxc.ca>
Sat, 14 Aug 2010 23:03:19 +0000 (23:03 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sat, 14 Aug 2010 23:03:19 +0000 (23:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111084 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Rewrite/FixItRewriter.cpp

index 875af7a7c77b88a3c9f1df854a1207d75d80ccfa..20cefb01655757253b4554b8c48b447f519dc47d 100644 (file)
@@ -49,7 +49,7 @@ bool FixItRewriter::WriteFixedFile(FileID ID, llvm::raw_ostream &OS) {
 }
 
 bool FixItRewriter::WriteFixedFiles() {
-  if (NumFailures > 0 && !FixItOpts->FixWhatYouCan) {
+  if (NumFailures > 0 && (!FixItOpts || !FixItOpts->FixWhatYouCan)) {
     Diag(FullSourceLoc(), diag::warn_fixit_no_changes);
     return true;
   }