diff options
author | Jordy Rose <jediknil@belkadan.com> | 2011-06-27 20:36:38 +0000 |
---|---|---|
committer | Jordy Rose <jediknil@belkadan.com> | 2011-06-27 20:36:38 +0000 |
commit | eda368791b21aafaf87012c8552dc5181c0ff7a1 (patch) | |
tree | 2011e194d69f26ccf9acf3cf85646e6d5a2b3b6f /lib/StaticAnalyzer/Core/RegionStore.cpp | |
parent | 37ac1ea86c11f0163e6f88af421fd50b81fb300d (diff) |
[analyzer] Use UnknownVal when default-initializing arrays whose element types we don't model, to distinguish them from uninitialized arrays (PR10163).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133937 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/RegionStore.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/RegionStore.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp index d0d8f601f0..23dd6416a8 100644 --- a/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -1377,7 +1377,12 @@ StoreRef RegionStoreManager::setImplicitDefaultValue(Store store, V = svalBuilder.makeZeroVal(Ctx.IntTy); } else { - return StoreRef(store, *this); + // We can't represent values of this type, but we still need to set a value + // to record that the region has been initialized. + // If this assertion ever fires, a new case should be added above -- we + // should know how to default-initialize any value we can symbolicate. + assert(!SymbolManager::canSymbolicate(T) && "This type is representable"); + V = UnknownVal(); } return StoreRef(addBinding(B, R, BindingKey::Default, |