From c070843ca4a81507549a57717520625410b658fc Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 29 Jul 2010 00:28:40 +0000 Subject: [PATCH] Explicitly guard in BasicStore from storing to non-scalars. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109708 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Checker/BasicStore.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/Checker/BasicStore.cpp b/lib/Checker/BasicStore.cpp index 3c781138ac..db2e3edb3e 100644 --- a/lib/Checker/BasicStore.cpp +++ b/lib/Checker/BasicStore.cpp @@ -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); } -- 2.40.0