]> granicus.if.org Git - clang/commit
[analyzer] Check the stack frame when looking for a var's initialization.
authorJordan Rose <jordan_rose@apple.com>
Fri, 3 May 2013 05:47:31 +0000 (05:47 +0000)
committerJordan Rose <jordan_rose@apple.com>
Fri, 3 May 2013 05:47:31 +0000 (05:47 +0000)
commit2faee99ab67105e834d11df7db80a78a3e3ed37b
tree69c34dd668b8ec2ebfbf0ebb34ed87c08a9a9201
parentdcd6224911e234ab3657b7d0b79a2add1ae4fdd8
[analyzer] Check the stack frame when looking for a var's initialization.

FindLastStoreBRVisitor is responsible for finding where a particular region
gets its value; if the region is a VarRegion, it's possible that value was
assigned at initialization, i.e. at its DeclStmt. However, if a function is
called recursively, the same DeclStmt may be evaluated multiple times in
multiple stack frames. FindLastStoreBRVisitor was not taking this into
account and just picking the first one it saw.

<rdar://problem/13787723>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180997 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
test/Analysis/inlining/false-positive-suppression.c