]> granicus.if.org Git - clang/commit
[analyzer] Mark a failed-realloc's result as an interesting symbol between the reallo...
authorJordy Rose <jediknil@belkadan.com>
Sun, 18 Mar 2012 07:43:35 +0000 (07:43 +0000)
committerJordy Rose <jediknil@belkadan.com>
Sun, 18 Mar 2012 07:43:35 +0000 (07:43 +0000)
commit393f98b5b7f7c950d2b0a7d84501b5dfd00ad780
tree391c1596283c8fcac53d9d144870f05d64a87c48
parent4207edaf03da28fa917a94b31c5c1eef0e6417dc
[analyzer] Mark a failed-realloc's result as an interesting symbol between the realloc call and the null check, so we get nicer path notes. Fixes a regression introduced by the diagnostic pruning added in r152361.

This is accomplished by calling markInteresting /during/ path diagnostic generation, and as such relies on deterministic ordering of BugReporterVisitors -- namely, that BugReporterVisitors are run in /reverse/ order from how they are added. (Right now that's a consequence of storing visitors in an ImmutableList, where new items are added to the front.) It's a little hacky, but it works for now.

I think this is the best we can do without storing the relation between the old and new symbols, and that would be a hit whether or not there ends up being an error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153010 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
test/Analysis/malloc-plist.c