diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-02-18 22:02:57 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-02-18 22:02:57 +0000 |
commit | e215ba1c2a3f29fe2cbc4cfb0e532cd204970c49 (patch) | |
tree | cc52b9d18aed9d722381d54da9016f63694e9a44 /lib/AST/ParentMap.cpp | |
parent | a979712238d6285e79e8f1d6e8b813a1f640e88c (diff) |
Fix crash in analyzer diagnostic generation involving subexpressions of OpaqueValueExpr not appearing in the ParentMap. Fixes <rdar://problem/10797980>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ParentMap.cpp')
-rw-r--r-- | lib/AST/ParentMap.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/ParentMap.cpp b/lib/AST/ParentMap.cpp index 5eef83a81a..64016d9cdd 100644 --- a/lib/AST/ParentMap.cpp +++ b/lib/AST/ParentMap.cpp @@ -26,6 +26,10 @@ static void BuildParentMap(MapTy& M, Stmt* S) { M[*I] = S; BuildParentMap(M, *I); } + + // Also include the source expr tree of an OpaqueValueExpr in the map. + if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S)) + BuildParentMap(M, OVE->getSourceExpr()); } ParentMap::ParentMap(Stmt* S) : Impl(0) { |