Remove bogus assertion in IdempotentOperationsChecker.

llvm-svn: 127687
This commit is contained in:
Ted Kremenek 2011-03-15 19:27:57 +00:00
parent 1a37ae40e1
commit cdb2ae587a
2 changed files with 14 additions and 3 deletions

View File

@ -336,10 +336,9 @@ void IdempotentOperationChecker::checkPostStmt(const BinaryOperator *B,
= cast<StmtPoint>(C.getPredecessor()->getLocation()).getStmt();
// Ignore implicit calls to setters.
if (isa<ObjCPropertyRefExpr>(predStmt))
if (!isa<BinaryOperator>(predStmt))
return;
assert(isa<BinaryOperator>(predStmt));
Data.explodedNodes.Add(C.getPredecessor());
}

View File

@ -40,3 +40,15 @@ void pr9116(NSObject *placeholder) {
int x = placeholder.media.locked = placeholder ? 1 : 0;
}
// <rdar://problem/9130239>: Test that calling property setters doesn't
// trigger an assertion failure when the object is nil.
@interface RDar9130239
@property (assign) id delegate;
@end
void test_RDar9130239(RDar9130239 *x) {
if (x)
return;
x.delegate = x; // no-warning
}