[arcmt] When capturing ARC errors, have a sanity check to make sure
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 12 Dec 2012 22:48:28 +0000 (22:48 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 12 Dec 2012 22:48:28 +0000 (22:48 +0000)
the diagnostic has a valid location.

llvm-svn: 170040

clang/lib/ARCMigrate/ARCMT.cpp

index df96ac8..6b1da08 100644 (file)
@@ -130,7 +130,8 @@ public:
                                 const Diagnostic &Info) {
     if (DiagnosticIDs::isARCDiagnostic(Info.getID()) ||
         level >= DiagnosticsEngine::Error || level == DiagnosticsEngine::Note) {
-      CapturedDiags.push_back(StoredDiagnostic(level, Info));
+      if (Info.getLocation().isValid())
+        CapturedDiags.push_back(StoredDiagnostic(level, Info));
       return;
     }