diff options
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/PlistDiagnostics.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Frontend/PlistDiagnostics.cpp b/lib/Frontend/PlistDiagnostics.cpp index 9649cf6188..575c3f3bfc 100644 --- a/lib/Frontend/PlistDiagnostics.cpp +++ b/lib/Frontend/PlistDiagnostics.cpp @@ -267,6 +267,10 @@ void PlistDiagnostics::HandlePathDiagnostic(const PathDiagnostic* D) { return; } + // We need to flatten the locations (convert Stmt* to locations) because + // the referenced statements may be freed by the time the diagnostics + // are emitted. + const_cast<PathDiagnostic*>(D)->flattenLocations(); BatchedDiags.push_back(D); } |