Commit Graph

4 Commits

Author SHA1 Message Date
Artem Dergachev e9f1edaae1 [analyzer] RunLoopAutoreleaseLeakChecker: Come up with a test for r348822.
Statement memoization was removed in r348822 because it was noticed to cause
memory corruption. This was happening because a reference to an object
in a DenseMap was used after being invalidated by inserting a new key
into the map.

This test case crashes reliably under ASan (i.e., when Clang is built with
-DLLVM_USE_SANITIZER="Address") on at least some machines before r348822
and doesn't crash after it.

llvm-svn: 349000
2018-12-13 01:30:47 +00:00
George Karpenkov 81c84a9755 [analyzer] Bugfix for autorelease + main run loop leak checker
Do not warn when the other message-send-expression is correctly wrapped
in a different autorelease pool.

Differential Revision: https://reviews.llvm.org/D49921

llvm-svn: 338314
2018-07-30 22:18:21 +00:00
George Karpenkov f44b9070b9 [analyzer] Fix crash in RunLoopAutoreleaseChecker on empty children
Differential Revision: https://reviews.llvm.org/D50012

llvm-svn: 338312
2018-07-30 21:44:15 +00:00
George Karpenkov 7112483272 [analyzer] Syntactic matcher for leaks associated with run loop and autoreleasepool
A checker for detecting leaks resulting from allocating temporary
autoreleasing objects before starting the main run loop.

Checks for two antipatterns:

1. ObjCMessageExpr followed by [[NARunLoop mainRunLoop] run] in the same
autorelease pool.

2. ObjCMessageExpr followed by [[NARunLoop mainRunLoop] run] in no
autorelease pool.

Happens-before relationship is modeled purely syntactically.

rdar://39299145

Differential Revision: https://reviews.llvm.org/D49528

llvm-svn: 337876
2018-07-25 01:27:15 +00:00