]> granicus.if.org Git - clang/commitdiff
Correct size assumption; fixes a crash on amd64.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Mon, 26 Jan 2009 19:54:12 +0000 (19:54 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Mon, 26 Jan 2009 19:54:12 +0000 (19:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63031 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/RegionStore.cpp

index f519d4d1cd1b17375ae4338ab9372e3f8f8672bf..e50b0abb61e62075e6cc163f29fe0276b46cfcb6 100644 (file)
@@ -888,7 +888,8 @@ const GRState* RegionStoreManager::BindArray(const GRState* St,
   ConstantArrayType* CAT = cast<ConstantArrayType>(T.getTypePtr());
 
   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)) {