diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-04-02 05:13:24 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-04-02 05:13:24 +0000 |
commit | 96a69267fc771dcb288bb7b3c5b5b6d49a9542ff (patch) | |
tree | 73ca6201973b9fef0ef76cd52a02d732cec5b11f /lib/Frontend/PlistDiagnostics.cpp | |
parent | ef5cc75782f7c3537ae81cc2a1f3aef8a5cd4c26 (diff) |
Hack: Add 'PathDiagnostic::flattenLocations()'. Because PlistDiagnosticClient
can use a PathLocation after any reference Stmts are reclaimed,
flattenLocation() converts those references to statements to source ranges.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PlistDiagnostics.cpp')
-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); } |