aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/ObjCAtSyncChecker.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-10-21 15:38:55 +0000
committerTed Kremenek <kremenek@apple.com>2010-10-21 15:38:55 +0000
commit1adee4b62016e7db899019b1d5a63c30bd61af06 (patch)
tree0d8911907a3d88b24e4d00deee3a613e18a867b9 /lib/Checker/ObjCAtSyncChecker.cpp
parent1a6f72df4b29544b10b3068504301e01d41d52da (diff)
Tweak the ObjCAtSyncChecker to assume that a mutex is non-nil after checking that it is
nil. Otherwise we can get false paths where a second @synchronized using the mutex can have a bogus warning. Fixes <rdar://problem/8578650>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117016 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/ObjCAtSyncChecker.cpp')
-rw-r--r--lib/Checker/ObjCAtSyncChecker.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Checker/ObjCAtSyncChecker.cpp b/lib/Checker/ObjCAtSyncChecker.cpp
index dc2e664e05..41580955a9 100644
--- a/lib/Checker/ObjCAtSyncChecker.cpp
+++ b/lib/Checker/ObjCAtSyncChecker.cpp
@@ -75,13 +75,15 @@ void ObjCAtSyncChecker::PreVisitObjCAtSynchronizedStmt(CheckerContext &C,
Ex);
C.EmitReport(report);
+ return;
}
}
- // From this point forward, we know that the mutex is null.
- C.addTransition(nullState);
+ // Don't add a transition for 'nullState'. If the value is
+ // under-constrained to be null or non-null, assume it is non-null
+ // afterwards.
}
if (notNullState)
C.addTransition(notNullState);
}
-
+