Skip to content

Commit 489feee

Browse files
committed
[arcmt] When capturing ARC errors, have a sanity check to make sure
the diagnostic has a valid location. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170040 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 135aa60 commit 489feee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/ARCMigrate/ARCMT.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ class CaptureDiagnosticConsumer : public DiagnosticConsumer {
130130
const Diagnostic &Info) {
131131
if (DiagnosticIDs::isARCDiagnostic(Info.getID()) ||
132132
level >= DiagnosticsEngine::Error || level == DiagnosticsEngine::Note) {
133-
CapturedDiags.push_back(StoredDiagnostic(level, Info));
133+
if (Info.getLocation().isValid())
134+
CapturedDiags.push_back(StoredDiagnostic(level, Info));
134135
return;
135136
}
136137

0 commit comments

Comments
 (0)