]> granicus.if.org Git - clang/commitdiff
Explicitly guard in BasicStore from storing to non-scalars.
authorTed Kremenek <kremenek@apple.com>
Thu, 29 Jul 2010 00:28:40 +0000 (00:28 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 29 Jul 2010 00:28:40 +0000 (00:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109708 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/BasicStore.cpp

index 3c781138ace10b7e0013c64e615b80e88855534d..db2e3edb3eb8c662d563031dbd1f62181978196e 100644 (file)
@@ -465,12 +465,9 @@ Store BasicStoreManager::BindDeclInternal(Store store, const VarRegion* VR,
         if (Loc::IsLocType(T))
           store = Bind(store, loc::MemRegionVal(VR),
                        loc::ConcreteInt(BasicVals.getValue(0, T)));
-        else if (T->isIntegerType())
+        else if (T->isIntegerType() && T->isScalarType())
           store = Bind(store, loc::MemRegionVal(VR),
                        nonloc::ConcreteInt(BasicVals.getValue(0, T)));
-        else {
-          // assert(0 && "ignore other types of variables");
-        }
       } else {
         store = Bind(store, loc::MemRegionVal(VR), *InitVal);
       }
@@ -478,7 +475,8 @@ Store BasicStoreManager::BindDeclInternal(Store store, const VarRegion* VR,
   } else {
     // Process local scalar variables.
     QualType T = VD->getType();
-    if (ValMgr.getSymbolManager().canSymbolicate(T)) {
+    // BasicStore only supports scalars.
+    if (T->isScalarType() && ValMgr.getSymbolManager().canSymbolicate(T)) {
       SVal V = InitVal ? *InitVal : UndefinedVal();
       store = Bind(store, loc::MemRegionVal(VR), V);
     }