diff options
author | Marcin Swiderski <marcin.sfider@gmail.com> | 2010-11-17 06:22:54 +0000 |
---|---|---|
committer | Marcin Swiderski <marcin.sfider@gmail.com> | 2010-11-17 06:22:54 +0000 |
commit | 0aac2ba128eb0c4b7ad5e0e28a6fa55091bfad2e (patch) | |
tree | 582cbfd5e8b43857e7b93a27b26cbf27e59198b9 /lib/Checker/BasicStore.cpp | |
parent | 47fc7e93b6af9e6a967231133a2f4bc626eeed26 (diff) |
Added mapping from 'this' to it's SymbolicRegion in BasicStoreManager::getInitialStore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/BasicStore.cpp')
-rw-r--r-- | lib/Checker/BasicStore.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Checker/BasicStore.cpp b/lib/Checker/BasicStore.cpp index d3860235ec..3a5d20ca00 100644 --- a/lib/Checker/BasicStore.cpp +++ b/lib/Checker/BasicStore.cpp @@ -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; } |