forked from OSchip/llvm-project
Add check for UnknownVals for mutexes in ObjCAtSyncChecker. Fixes crash reported in PR 8458.
llvm-svn: 117300
This commit is contained in:
parent
b3a48f3459
commit
c07d8353e1
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue