]> granicus.if.org Git - clang/commit
[analyzer] Don't reinitialize static globals more than once along a path
authorAnna Zaks <ganna@apple.com>
Thu, 7 Feb 2013 23:05:37 +0000 (23:05 +0000)
committerAnna Zaks <ganna@apple.com>
Thu, 7 Feb 2013 23:05:37 +0000 (23:05 +0000)
commit2b6876173b36d92aaf379c29cb339d91b4d358ee
tree74f68181c24bf0b090b9b17a18d7ccbcc3fae7ca
parent250172a851a886c0763b5fd61c20bf21791c21e9
[analyzer] Don't reinitialize static globals more than once along a path

This patch makes sure that we do not reinitialize static globals when
the function is called more than once along a path. The motivation is
code with initialization patterns that rely on 2 static variables, where
one of them has an initializer while the other does not. Currently, we
reset the static variables with initializers on every visit to the
function along a path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174676 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngineC.cpp
test/Analysis/global-region-invalidation.c
test/Analysis/global_region_invalidation.mm [new file with mode: 0644]