diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-06-30 13:00:53 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-06-30 13:00:53 +0000 |
commit | 703db197e36af320f3612be16f276a4c01e8ef29 (patch) | |
tree | ad3e61890ec258eb37c5bf91a1879326e205cb56 /clang/lib/Analysis | |
parent | e205d43c750f29bd36edc82d7cc7ea34c775e900 (diff) | |
download | bcm5719-llvm-703db197e36af320f3612be16f276a4c01e8ef29.tar.gz bcm5719-llvm-703db197e36af320f3612be16f276a4c01e8ef29.zip |
Instead of r74522, use another approach to fix xfail_regionstore_wine_crash.c.
Mark the super region of the binding of block level expr in the Environment
as live.
llvm-svn: 74525
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r-- | clang/lib/Analysis/Environment.cpp | 13 | ||||
-rw-r--r-- | clang/lib/Analysis/LiveVariables.cpp | 1 |
2 files changed, 11 insertions, 3 deletions
diff --git a/clang/lib/Analysis/Environment.cpp b/clang/lib/Analysis/Environment.cpp index 2b751df830c..1c2802e7fe9 100644 --- a/clang/lib/Analysis/Environment.cpp +++ b/clang/lib/Analysis/Environment.cpp @@ -143,8 +143,17 @@ 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. + 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); diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp index b354566db02..aead7f43ad8 100644 --- a/clang/lib/Analysis/LiveVariables.cpp +++ b/clang/lib/Analysis/LiveVariables.cpp @@ -138,7 +138,6 @@ void TransferFuncs::Visit(Stmt *S) { else { // For block-level expressions, mark that they are live. LiveState(S,AD) = Alive; - StmtVisitor<TransferFuncs,void>::Visit(S); } } |