Added mapping from 'this' to it's SymbolicRegion in BasicStoreManager::getInitialStore.

llvm-svn: 119467
This commit is contained in:
Marcin Swiderski 2010-11-17 06:22:54 +00:00
parent 776a30ddfc
commit 2b2cd0e6b4
1 changed files with 9 additions and 0 deletions

View File

@ -419,6 +419,15 @@ Store BasicStoreManager::getInitialStore(const LocationContext *InitLoc) {
}
}
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;
}