Add check for UnknownVals for mutexes in ObjCAtSyncChecker. Fixes crash reported in PR 8458.

llvm-svn: 117300
This commit is contained in:
Ted Kremenek 2010-10-25 20:20:56 +00:00
parent b3a48f3459
commit c07d8353e1
2 changed files with 13 additions and 0 deletions

View File

@ -57,6 +57,9 @@ void ObjCAtSyncChecker::PreVisitObjCAtSynchronizedStmt(CheckerContext &C,
return;
}
if (V.isUnknown())
return;
// Check for null mutexes.
const GRState *notNullState, *nullState;
llvm::tie(notNullState, nullState) = state->Assume(cast<DefinedSVal>(V));

View File

@ -1149,3 +1149,13 @@ void pr8149(void) {
for (; ({ do { } while (0); 0; });) { }
}
// PR 8458 - Make sure @synchronized doesn't crash with properties.
@interface PR8458 {}
@property(readonly) id lock;
@end
static
void __PR8458(PR8458 *x) {
@synchronized(x.lock) {} // no-warning
}