diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-12-02 16:47:35 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-12-02 16:47:35 +0000 |
commit | 500386194c73b7976894278a7da08ad9b59ec81e (patch) | |
tree | 0f7be1472c2e09e7e344167d045ae9096e80a787 /lib/Analysis/RegionStore.cpp | |
parent | fb4ccd7152723ac6190eb379250cfe7516cfd1b8 (diff) |
Make RegionStoreManager::InitializeArray safe against array sizes that don't have pointer width.
This may be the case on 64-bit systems. Whether that fact is a bug is a different question, but it's easy to cure the symptom.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60422 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r-- | lib/Analysis/RegionStore.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp index 92f4a6e714..9753b914f2 100644 --- a/lib/Analysis/RegionStore.cpp +++ b/lib/Analysis/RegionStore.cpp @@ -639,7 +639,8 @@ Store RegionStoreManager::InitializeArray(Store store, const TypedRegion* R, llvm::APSInt Size(CAT->getSize(), false); - llvm::APSInt i = getBasicVals().getZeroWithPtrWidth(false); + llvm::APSInt i = getBasicVals().getValue(0, Size.getBitWidth(), + Size.isUnsigned()); // Check if the init expr is a StringLiteral. if (isa<loc::MemRegionVal>(Init)) { |