]> granicus.if.org Git - clang/commitdiff
Fix the fix of revision 59974. Now array-struct.c passes too.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Mon, 24 Nov 2008 19:39:40 +0000 (19:39 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Mon, 24 Nov 2008 19:39:40 +0000 (19:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59975 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/RegionStore.cpp

index 747b16d7b6d9ed23676506a99929b8a04f36128b..e2dd176139d38644a249cdb034c4db1c54fd81e7 100644 (file)
@@ -262,7 +262,8 @@ SVal RegionStoreManager::getLValueElement(const GRState* St,
     if (CI2->getValue().isUnsigned() ||
         CI2->getValue().getBitWidth() < CI1->getValue().getBitWidth()) {
       llvm::APSInt SI = CI2->getValue();
-      SI.extend(CI1->getValue().getBitWidth());
+      if (CI2->getValue().getBitWidth() < CI1->getValue().getBitWidth())
+        SI.extend(CI1->getValue().getBitWidth());
       SI.setIsSigned(true);
       SignedInt = nonloc::ConcreteInt(getBasicVals().getValue(SI));
       CI2 = cast<nonloc::ConcreteInt>(&SignedInt);