diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-06-16 06:18:21 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-06-16 06:18:21 +0000 |
commit | 78d5b5e738c81b596f20205437120d5f3d7c5d9e (patch) | |
tree | 7857427f041a02f883bb616a7559c57a1270a07d | |
parent | f54741e6465692d3bdbae974ac3beeeab92e4a95 (diff) |
Do not invalidate unboundable regions in GRSimpleVals::EvalCall().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73474 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/GRSimpleVals.cpp | 8 | ||||
-rw-r--r-- | test/Analysis/func.c | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp index e1c4848f45..d8d312f23f 100644 --- a/lib/Analysis/GRSimpleVals.cpp +++ b/lib/Analysis/GRSimpleVals.cpp @@ -365,9 +365,11 @@ void GRSimpleVals::EvalCall(ExplodedNodeSet<GRState>& Dst, SVal V = StateMgr.GetSVal(St, *I); - if (isa<loc::MemRegionVal>(V)) - St = StateMgr.BindLoc(St, cast<Loc>(V), UnknownVal()); - else if (isa<nonloc::LocAsInteger>(V)) + if (isa<loc::MemRegionVal>(V)) { + const MemRegion *R = cast<loc::MemRegionVal>(V).getRegion(); + if (R->isBoundable(Eng.getContext())) + St = StateMgr.BindLoc(St, cast<Loc>(V), UnknownVal()); + } else if (isa<nonloc::LocAsInteger>(V)) St = StateMgr.BindLoc(St, cast<nonloc::LocAsInteger>(V).getLoc(), UnknownVal()); diff --git a/test/Analysis/func.c b/test/Analysis/func.c index ac067a9810..a018d0afc1 100644 --- a/test/Analysis/func.c +++ b/test/Analysis/func.c @@ -1,4 +1,5 @@ // RUN: clang-cc -analyze -checker-simple -verify %s && +// RUN: clang-cc -analyze -checker-simple -analyzer-store=region -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s && // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s |