[cfe-commits] r119467 - /cfe/trunk/lib/Checker/BasicStore.cpp
Marcin Swiderski
marcin.sfider at gmail.com
Tue Nov 16 22:22:55 PST 2010
Author: sfider
Date: Wed Nov 17 00:22:54 2010
New Revision: 119467
URL: http://llvm.org/viewvc/llvm-project?rev=119467&view=rev
Log:
Added mapping from 'this' to it's SymbolicRegion in BasicStoreManager::getInitialStore.
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=119467&r1=119466&r2=119467&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/BasicStore.cpp (original)
+++ cfe/trunk/lib/Checker/BasicStore.cpp Wed Nov 17 00:22:54 2010
@@ -419,6 +419,15 @@
}
}
+ if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(InitLoc->getDecl())) {
+ // For C++ methods add symbolic region for 'this' in initial stack frame.
+ QualType ThisT = MD->getThisType(StateMgr.getContext());
+ MemRegionManager &RegMgr = ValMgr.getRegionManager();
+ const CXXThisRegion *ThisR = RegMgr.getCXXThisRegion(ThisT, InitLoc);
+ SVal ThisV = ValMgr.getRegionValueSymbolVal(ThisR);
+ St = Bind(St, ValMgr.makeLoc(ThisR), ThisV);
+ }
+
return St;
}
More information about the cfe-commits
mailing list