diff options
author | Artem Dergachev <artem.dergachev@gmail.com> | 2017-01-25 10:21:45 +0000 |
---|---|---|
committer | Artem Dergachev <artem.dergachev@gmail.com> | 2017-01-25 10:21:45 +0000 |
commit | 55705955ce89f9bec71c546d00e05b9b3d721e0c (patch) | |
tree | 127a9dfd04b31fd62d8d5113197b602512a7ac72 /clang/lib/StaticAnalyzer/Core/RegionStore.cpp | |
parent | d28ab559a7e4c60bb56e5944bffe5085b7b16072 (diff) | |
download | bcm5719-llvm-55705955ce89f9bec71c546d00e05b9b3d721e0c.tar.gz bcm5719-llvm-55705955ce89f9bec71c546d00e05b9b3d721e0c.zip |
[analyzer] Fix MacOSXAPIChecker fp with static locals seen from nested blocks.
This is an attempt to avoid new false positives caused by the reverted r292800,
however the scope of the fix is significantly reduced - some variables are still
in incorrect memory spaces.
Relevant test cases added.
rdar://problem/30105546
rdar://problem/30156693
Differential revision: https://reviews.llvm.org/D28946
llvm-svn: 293043
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/RegionStore.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp index 15ca2c14f94..934cc5cd3ac 100644 --- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -1849,6 +1849,8 @@ SVal RegionStoreManager::getBindingForVar(RegionBindingsConstRef B, // Function-scoped static variables are default-initialized to 0; if they // have an initializer, it would have been processed by now. + // FIXME: This is only true when we're starting analysis from main(). + // We're losing a lot of coverage here. if (isa<StaticGlobalSpaceRegion>(MS)) return svalBuilder.makeZeroVal(T); |