[cfe-commits] r73474 - in /cfe/trunk: lib/Analysis/GRSimpleVals.cpp test/Analysis/func.c

Zhongxing Xu xuzhongxing at gmail.com
Mon Jun 15 23:18:21 PDT 2009


Author: zhongxingxu
Date: Tue Jun 16 01:18:21 2009
New Revision: 73474

URL: http://llvm.org/viewvc/llvm-project?rev=73474&view=rev
Log:
Do not invalidate unboundable regions in GRSimpleVals::EvalCall().

Modified:
    cfe/trunk/lib/Analysis/GRSimpleVals.cpp
    cfe/trunk/test/Analysis/func.c

Modified: cfe/trunk/lib/Analysis/GRSimpleVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRSimpleVals.cpp?rev=73474&r1=73473&r2=73474&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRSimpleVals.cpp (original)
+++ cfe/trunk/lib/Analysis/GRSimpleVals.cpp Tue Jun 16 01:18:21 2009
@@ -365,9 +365,11 @@
 
     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());
     

Modified: cfe/trunk/test/Analysis/func.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/func.c?rev=73474&r1=73473&r2=73474&view=diff

==============================================================================
--- cfe/trunk/test/Analysis/func.c (original)
+++ cfe/trunk/test/Analysis/func.c Tue Jun 16 01:18:21 2009
@@ -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
 





More information about the cfe-commits mailing list