[cfe-commits] r109708 - /cfe/trunk/lib/Checker/BasicStore.cpp

Ted Kremenek kremenek at apple.com
Wed Jul 28 17:28:40 PDT 2010


Author: kremenek
Date: Wed Jul 28 19:28:40 2010
New Revision: 109708

URL: http://llvm.org/viewvc/llvm-project?rev=109708&view=rev
Log:
Explicitly guard in BasicStore from storing to non-scalars.

Modified:
    cfe/trunk/lib/Checker/BasicStore.cpp

Modified: cfe/trunk/lib/Checker/BasicStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/BasicStore.cpp?rev=109708&r1=109707&r2=109708&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/BasicStore.cpp (original)
+++ cfe/trunk/lib/Checker/BasicStore.cpp Wed Jul 28 19:28:40 2010
@@ -465,12 +465,9 @@
         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 @@
   } 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);
     }





More information about the cfe-commits mailing list