[cfe-commits] r86836 - /cfe/trunk/lib/Analysis/GRExprEngine.cpp

Zhongxing Xu xuzhongxing at gmail.com
Wed Nov 11 06:52:39 CST 2009


Author: zhongxingxu
Date: Wed Nov 11 06:52:39 2009
New Revision: 86836

URL: http://llvm.org/viewvc/llvm-project?rev=86836&view=rev
Log:
Remove the old out-of-bound checking code.

Modified:
    cfe/trunk/lib/Analysis/GRExprEngine.cpp

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

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Wed Nov 11 06:52:39 2009
@@ -1270,48 +1270,6 @@
     // Update which NodeSet is the current one.
     PrevSet = CurrSet;
   }
-  
-  // FIXME: Temporarily disable out-of-bounds checking until we make
-  // the logic reflect recent changes to CastRegion and friends.
-#if 0
-  // Check for out-of-bound array access.
-  if (isa<loc::MemRegionVal>(LV)) {
-    const MemRegion* R = cast<loc::MemRegionVal>(LV).getRegion();
-    if (const ElementRegion* ER = dyn_cast<ElementRegion>(R)) {
-      // Get the index of the accessed element.
-      SVal Idx = ER->getIndex();
-      // Get the extent of the array.
-      SVal NumElements = getStoreManager().getSizeInElements(StNotNull,
-                                                          ER->getSuperRegion());
-
-      const GRState * StInBound = StNotNull->AssumeInBound(Idx, NumElements,
-                                                           true);
-      const GRState* StOutBound = StNotNull->AssumeInBound(Idx, NumElements,
-                                                           false);
-
-      if (StOutBound) {
-        // Report warning.  Make sink node manually.
-        ExplodedNode* OOBNode =
-          Builder->generateNode(Ex, StOutBound, Pred,
-                                ProgramPoint::PostOutOfBoundsCheckFailedKind);
-
-        if (OOBNode) {
-          OOBNode->markAsSink();
-
-          if (StInBound)
-            ImplicitOOBMemAccesses.insert(OOBNode);
-          else
-            ExplicitOOBMemAccesses.insert(OOBNode);
-        }
-      }
-
-      if (!StInBound)
-        return NULL;
-
-      StNotNull = StInBound;
-    }
-  }
-#endif
 }
 
 //===----------------------------------------------------------------------===//




More information about the cfe-commits mailing list