Commit Graph

22 Commits

Author SHA1 Message Date
Anna Zaks 0af3e06ff6 [analyzer] Rework inlining related command line options.
- Remove -analyzer-inline-call.
 - Add -analyzer-ipa=[none|inlining]
 - Add -analyzer-inlining-mode to allow experimentation for
different performance tuning methods.

llvm-svn: 152351
2012-03-08 23:16:35 +00:00
Anna Zaks 6ca4fd5b88 [analyzer] Leaks should be uniqued by the allocation point in the
closest function context (Keychain API).

llvm-svn: 151613
2012-02-28 03:07:06 +00:00
Anna Zaks 06a77fc1b9 [analyzer] Fix Malloc False Positive (PR 12100)
When allocated buffer is passed to CF/NS..NoCopy functions, the
ownership is transfered unless the deallocator argument is set to
'kCFAllocatorNull'.

llvm-svn: 151608
2012-02-28 01:54:22 +00:00
Anna Zaks 18de54b1a6 [analyzer] Run remove dead bindings before each call.
This ensures that we report the bugs associated with symbols going
out of scope in the correct function context.

llvm-svn: 151369
2012-02-24 16:49:46 +00:00
Anna Zaks 4b062cb904 [analyzer] KeyChainAPI: unique the leaks by allocation site.
(Very similar to the previous change in malloc.)

llvm-svn: 151297
2012-02-23 22:53:29 +00:00
Anna Zaks 19a66678d5 [analyzer] Make KeyChainAPI checker inlining-aware.
llvm-svn: 151007
2012-02-21 00:00:44 +00:00
Anna Zaks 719051e1c6 [analyzer] Make KeychainAPI checker less aggressive. radar://10508828
We trigger an error if free is called after a possibly failed allocation. Do not trigger the error if we know that the buffer is not null.

llvm-svn: 145584
2011-12-01 16:41:58 +00:00
Anna Zaks 814adf7752 Fix: Bug 10798 - [analyzer] Crash when analyzing ICU. (A slight improvement on the previous commit.)
llvm-svn: 138762
2011-08-29 20:43:37 +00:00
Anna Zaks cda129eb1c Fix bug 10797: Crash: "cast<Ty>() argument of incompatible type!" assert when analyzing ICU.
Patch by Jean-Daniel Dupas. Thanks for spotting and fixing!

llvm-svn: 138757
2011-08-29 20:05:54 +00:00
Anna Zaks 0897a23517 [analyzer] MacOSKeychainAPIChecker: Add reasoning about functions which MIGHT deallocate the memory region allocated with SecKeychain APIs. Specifically, when the buffer is passed to CFStringCreateWithBytesNoCopy along with a custom deallocator, which might potentially correctly release the memory.
llvm-svn: 138417
2011-08-24 00:06:27 +00:00
Anna Zaks bd7972b49e [analyzer] MacOSKeychainAPIChecker: Users of KeyChain API often use free() to deallocate the password. Catch this error explicitly and generate the error message at the place where free() is called.
llvm-svn: 138296
2011-08-22 23:18:12 +00:00
Anna Zaks a06421a02c MacOSKeychainAPIChecker: Turn it on by default.
llvm-svn: 137740
2011-08-16 20:02:05 +00:00
Anna Zaks 01ae1e1197 MacOSKeychainAPIChecker: Do not report double allocation if first allocation returned an error.
llvm-svn: 137720
2011-08-16 16:30:24 +00:00
Anna Zaks 80319c1702 MacOSKeychainAPIChecker: Test all APIs.
llvm-svn: 137549
2011-08-13 02:10:15 +00:00
Anna Zaks 59d741fec6 MacOSKeychainAPIChecker: If the allocated data address entered as an enclosing function parameter, skip it to avoid false positives.
llvm-svn: 137526
2011-08-12 22:47:22 +00:00
Anna Zaks fdd0aca0a5 MacOSKeychainAPIChecker:
Report errors earlier: on checkDeadSymbols() and clear the state after the symbol we are tracking goes out of scope. 

Also, perform lazy error checking. Instead of forcing the paths to be split depending one the return value of the allocator, make the return symbol depend on the allocated data symbol, which prolongs its life span to the time when the allocated data symbol becomes dead.

llvm-svn: 137523
2011-08-12 21:56:43 +00:00
Anna Zaks c52bed1814 KeychainAPI checker: Generate an error on double allocation. Pull out getAsPointeeMemoryRegion so that it could be reused.
llvm-svn: 136952
2011-08-05 00:37:00 +00:00
Anna Zaks 680be29584 KeychainAPI checker: forgot to commit the test with r136930. This should fix the bot.
llvm-svn: 136938
2011-08-04 22:40:38 +00:00
Anna Zaks 388c18ec7f KeychainAPI checker: Add basic diagnostics. Track MemoryRegion istead of SymbolicRef since the address might not be a symbolic value in some cases, for example in fooOnlyFree() test.
llvm-svn: 136851
2011-08-04 00:26:57 +00:00
Ted Kremenek 3f955e6d89 [analyzer] rename all experimental checker packages to have 'experimental' be the common root package.
llvm-svn: 136835
2011-08-03 23:14:55 +00:00
Anna Zaks 9ab728bb05 KeychainAPI checker: only check the paths on which the allocator function returned noErr. (+ minor cleanup)
llvm-svn: 136694
2011-08-02 17:11:03 +00:00
Anna Zaks 15f496c118 Add a skeleton for the Keychain Services API Checker. Register it as OSX experimental for now. Note, the checker still does not handle tracking of escaped values, taking into account the return value of the allocator functions, nor the actual bug reporting..
llvm-svn: 136659
2011-08-01 22:40:01 +00:00