mirror of https://github.com/microsoft/clang.git
Don't add a null successor to a CFGBlock when the contents of an @synchronized statement is empty.
Fixes <rdar://problem/7979430>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103717 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6bfd533600
commit
fadebbafe6
|
@ -1223,10 +1223,9 @@ CFGBlock* CFGBuilder::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt* S) {
|
|||
return 0;
|
||||
|
||||
Block = 0;
|
||||
Succ = SyncBlock;
|
||||
}
|
||||
|
||||
Succ = SyncBlock;
|
||||
|
||||
// Inline the sync expression.
|
||||
return addStmt(S->getSynchExpr());
|
||||
}
|
||||
|
|
|
@ -957,3 +957,13 @@ void pr6938_b() {
|
|||
}) == 0) {
|
||||
}
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// <rdar://problem/7979430> - The CFG for code containing an empty
|
||||
// @synchronized block was previously broken (and would crash the analyzer).
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void r7979430(id x) {
|
||||
@synchronized(x) {}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue