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 | 93b1b031c1506e473722761d9a0d7ddf9196dba3 (patch) | |
tree | 38a85aa071991af1e301f3a373f30cfad7fc9d2d /clang/lib/Analysis/ThreadSafety.cpp | |
parent | 63b1bc70eee9f153ac5a8f44fbbf6dd326e2793f (diff) | |
download | bcm5719-llvm-93b1b031c1506e473722761d9a0d7ddf9196dba3.tar.gz bcm5719-llvm-93b1b031c1506e473722761d9a0d7ddf9196dba3.zip |
Thread-safety analysis: bugfix for case where a trylock occurs in an
expression involving temporaries.
llvm-svn: 163237
Diffstat (limited to 'clang/lib/Analysis/ThreadSafety.cpp')
-rw-r--r-- | clang/lib/Analysis/ThreadSafety.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp index b89a83c8817..90c407ac656 100644 --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/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); |