summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/ThreadSafety.cpp
diff options
context:
space:
mode:
authorDeLesley Hutchins <delesley@google.com>2012-09-11 23:04:49 +0000
committerDeLesley Hutchins <delesley@google.com>2012-09-11 23:04:49 +0000
commit138568b60a40f634b0a8eb0afc5756c45844c452 (patch)
tree9813a8940fd52ec20f0545f0be8bbf621390150f /clang/lib/Analysis/ThreadSafety.cpp
parent03efc5e1eee15a4ae8ba98b4050b924239b96b1e (diff)
downloadbcm5719-llvm-138568b60a40f634b0a8eb0afc5756c45844c452.tar.gz
bcm5719-llvm-138568b60a40f634b0a8eb0afc5756c45844c452.zip
Thread-safety analysis: fix bug in expression matching code.
llvm-svn: 163656
Diffstat (limited to 'clang/lib/Analysis/ThreadSafety.cpp')
-rw-r--r--clang/lib/Analysis/ThreadSafety.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp
index 88759434805..196d5e1eb36 100644
--- a/clang/lib/Analysis/ThreadSafety.cpp
+++ b/clang/lib/Analysis/ThreadSafety.cpp
@@ -454,7 +454,6 @@ private:
void buildSExprFromExpr(Expr *MutexExp, Expr *DeclExp, const NamedDecl *D) {
CallingContext CallCtx(D);
-
if (MutexExp) {
if (StringLiteral* SLit = dyn_cast<StringLiteral>(MutexExp)) {
if (SLit->getString() == StringRef("*"))
@@ -562,7 +561,9 @@ public:
bool matches(const SExpr &Other, unsigned i = 0, unsigned j = 0) const {
if (NodeVec[i].matches(Other.NodeVec[j])) {
- unsigned n = NodeVec[i].arity();
+ unsigned ni = NodeVec[i].arity();
+ unsigned nj = Other.NodeVec[j].arity();
+ unsigned n = (ni < nj) ? ni : nj;
bool Result = true;
unsigned ci = i+1; // first child of i
unsigned cj = j+1; // first child of j
OpenPOWER on IntegriCloud