diff options
author | ed <ed@FreeBSD.org> | 2009-07-04 13:58:54 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-07-04 13:58:54 +0000 |
commit | 4981926bf654fe5a2c3893f24ca44106b217e71e (patch) | |
tree | 8ddfe382e1c6d590dc240e76f7cd45cea5c78e24 /lib/Analysis/Environment.cpp | |
parent | c1ff020ff2d3e7ba86f7ab986ac7569c34f2ab1a (diff) | |
download | FreeBSD-src-4981926bf654fe5a2c3893f24ca44106b217e71e.zip FreeBSD-src-4981926bf654fe5a2c3893f24ca44106b217e71e.tar.gz |
Import Clang r74788.
Diffstat (limited to 'lib/Analysis/Environment.cpp')
-rw-r--r-- | lib/Analysis/Environment.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/Analysis/Environment.cpp b/lib/Analysis/Environment.cpp index 2b751df..3f8f14d 100644 --- a/lib/Analysis/Environment.cpp +++ b/lib/Analysis/Environment.cpp @@ -143,8 +143,19 @@ EnvironmentManager::RemoveDeadBindings(Environment Env, Stmt* Loc, SVal X = I.getData(); // If the block expr's value is a memory region, then mark that region. - if (isa<loc::MemRegionVal>(X)) - DRoots.push_back(cast<loc::MemRegionVal>(X).getRegion()); + if (isa<loc::MemRegionVal>(X)) { + const MemRegion* R = cast<loc::MemRegionVal>(X).getRegion(); + DRoots.push_back(R); + // Mark the super region of the RX as live. + // e.g.: int x; char *y = (char*) &x; if (*y) ... + // 'y' => element region. 'x' is its super region. + // We only add one level super region for now. + + // FIXME: maybe multiple level of super regions should be added. + if (const SubRegion *SR = dyn_cast<SubRegion>(R)) { + DRoots.push_back(SR->getSuperRegion()); + } + } // Mark all symbols in the block expr's value live. MarkLiveCallback cb(SymReaper); |