diff options
author | DeLesley Hutchins <delesley@google.com> | 2012-09-05 20:01:16 +0000 |
---|---|---|
committer | DeLesley Hutchins <delesley@google.com> | 2012-09-05 20:01:16 +0000 |
commit | fd0f11ccd51154e933fad7dfa134cb4f62c87056 (patch) | |
tree | 66eb22138ba85606981bebedff8f9bac826a5e56 /lib/Analysis/ThreadSafety.cpp | |
parent | 255793d35bd5aa13ab2fd0b22f66b8e34698d8e0 (diff) |
Thread-safety analysis: bugfix for case where a trylock occurs in an
expression involving temporaries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163237 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ThreadSafety.cpp')
-rw-r--r-- | lib/Analysis/ThreadSafety.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Analysis/ThreadSafety.cpp b/lib/Analysis/ThreadSafety.cpp index b89a83c881..90c407ac65 100644 --- a/lib/Analysis/ThreadSafety.cpp +++ b/lib/Analysis/ThreadSafety.cpp @@ -1532,6 +1532,9 @@ const CallExpr* ThreadSafetyAnalyzer::getTrylockCallExpr(const Stmt *Cond, else if (const ImplicitCastExpr *CE = dyn_cast<ImplicitCastExpr>(Cond)) { return getTrylockCallExpr(CE->getSubExpr(), C, Negate); } + else if (const ExprWithCleanups* EWC = dyn_cast<ExprWithCleanups>(Cond)) { + return getTrylockCallExpr(EWC->getSubExpr(), C, Negate); + } else if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Cond)) { const Expr *E = LocalVarMap.lookupExpr(DRE->getDecl(), C); return getTrylockCallExpr(E, C, Negate); |