]> granicus.if.org Git - clang/commit
[analyzer] Create symbol-aware stack hints (building upon r152837).
authorAnna Zaks <ganna@apple.com>
Fri, 16 Mar 2012 23:24:20 +0000 (23:24 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 16 Mar 2012 23:24:20 +0000 (23:24 +0000)
commit56a938ff85a444eb3d30d2634d92ce5b1f6fae56
tree9d85719ed51903e12e39c5f7d4db93f727f37763
parent076add680e281709cf081052be0dcb822dc8f37d
[analyzer] Create symbol-aware stack hints (building upon r152837).

The symbol-aware stack hint combines the checker-provided message
with the information about how the symbol was passed to the callee: as
a parameter or a return value.

For malloc, the generated messages look like this :
"Returning from 'foo'; released memory via 1st parameter"
"Returning from 'foo'; allocated memory via 1st parameter"
"Returning from 'foo'; allocated memory returned"
"Returning from 'foo'; reallocation of 1st parameter failed"

(We are yet to handle cases when the symbol is a field in a struct or
an array element.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152962 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
lib/StaticAnalyzer/Core/BugReporter.cpp
lib/StaticAnalyzer/Core/PathDiagnostic.cpp
test/Analysis/malloc-plist.c