Skip to content
  1. Dec 20, 2008
  2. Dec 19, 2008
  3. Dec 17, 2008
    • Ted Kremenek's avatar
      CF-retain/release checker: · 62d4c12d
      Ted Kremenek authored
      - Fix regression reported in <rdar://problem/6452745>.  After a null check, null references to resources should not have a retain count.  This regression was caused by removing the call to "GRTransferFuncs::EvalAssume" in BasicConstraintManager.
      - Added a test case to test this behavior.
      
      llvm-svn: 61155
      62d4c12d
    • Ted Kremenek's avatar
      Fix <rdar://problem/6451816>: · 300c9cc8
      Ted Kremenek authored
      - Because of the introduction of AnonTypedRegions when reasoning about casts, we
        had a regression in the "symbolication" of variable values passed-by-reference
        to a function. This is now fixed in CFRefCount.cpp (-checker-cfref) by
        blasting through the layer of AnonTypedRegions when symbolicating the value of
        the variable. This logic may get moved elsewhere. Note that this change
        affects only -checker-cfref and not -checker-simple; eventually this logic
        should get pulled out of CFRefCount.cpp into a more common place. All users
        use -checker-cfref by default, and -checker-simple should probably just be
        removed.  
      - Updated test 'Analysis/uninit-vals-ps.c' to only use -checker-cfref and added
        a test case for this regression.
      
      llvm-svn: 61147
      300c9cc8
    • Ted Kremenek's avatar
      Add pretty-printing for AnonTypedRegion. · 29d34ec6
      Ted Kremenek authored
      llvm-svn: 61146
      29d34ec6
  4. Dec 16, 2008
    • Ted Kremenek's avatar
      Add new GRWorkList class that uses two queues: · d9de9f14
      Ted Kremenek authored
      - one queue (FIFO) to queue up nodes at block entrances
      - another queue (LIFO) to queue up other nodes
      - The idea is to explore basic blocks to completion, but to do a BFS exploration of blocks.
      
      llvm-svn: 61106
      d9de9f14
    • Ted Kremenek's avatar
      ProgramPoint: · 9e08ff40
      Ted Kremenek authored
      - Added four new ProgramPoint types that subclass PostStmt for use in
        GRExprEngine::EvalLocation:
        - PostOutOfBoundsCheckFailed
        - PostUndefLocationCheckFailed
        - PostNullCheckFailed
        - PostLocationChecksSucceed
        These were created because of a horribly subtle caching bug in EvalLocation
        where a node representing an "bug condition" in EvalLocation (e.g. a null
        dereference) could be re-used as the "non-bug condition" because the Store did
        not contain any information to differentiate between the two. The extra
        program points just disables any accidental caching between EvalLocation and
        its callers.
      
      GRExprEngine:
      - EvalLocation now returns a NodeTy* instead of GRState*.  This should be used as the "vetted" predecessor for EvalLoad/EvalStore.
      
      llvm-svn: 61105
      9e08ff40
    • Zhongxing Xu's avatar
      Implement RegionStoreManager::Remove(). · c4a4c5f0
      Zhongxing Xu authored
      llvm-svn: 61069
      c4a4c5f0
  5. Dec 15, 2008
  6. Dec 14, 2008
  7. Dec 13, 2008
    • Ted Kremenek's avatar
      MemRegion: · b5670fd5
      Ted Kremenek authored
      - Overhauled the notion of "types" for TypedRegions.  We now distinguish between the "lvalue" of a region (via getLValueRegion()) and the "rvalue" of a region (va getRValueRegion()).  Since a region represents a chunk of memory it has both, but we were conflating these concepts in some cases, leading to some insidious bugs.
      - Removed AnonPointeeType, partially because it is unused and because it doesn't have a clear notion of lvalue vs rvalue type.  We can add it back once there is a need for it and we can resolve its role with these concepts.
      
      StoreManager:
      - Overhauled StoreManager::CastRegion.  It expects an *lvalue* type for a region.  This is actually what motivated the overhaul to the MemRegion type mechanism.  It also no longer returns an SVal; we can just return a MemRegion*.
      - BasicStoreManager::CastRegion now overlays an "AnonTypedRegion" for pointer-pointer casts.  This matches with the MemRegion changes.
      - Similar changes to RegionStore, except I've added a bunch of FIXMEs where it wasn't 100% clear where we should use TypedRegion::getRValueRegion() or TypedRegion::getLValueRegion().
      
      AuditCFNumberCreate check:
      - Now blasts through AnonTypedRegions that may layer the original memory region, thus checking if the actually memory block is of the appropriate type.  This change was needed to work with the changes to StoreManager::CastRegion.
      
      GRExprEngine::VisitCast:
      - Conform to the new interface of StoreManager::CastRegion.
      
      Tests:
      - None of the analysis tests fail now for using the "basic store".
      - Disabled the tests 'array-struct.c' and 'rdar-6442306-1.m' pending further testing and bug fixing.
      
      llvm-svn: 60995
      b5670fd5
    • Ted Kremenek's avatar
      A series of cleanups/fixes motivated by <rdar://problem/6442306>: · f065b15f
      Ted Kremenek authored
      GRExprEngine (VisitCast):
      - When using StoreManager::CastRegion, always use the state and value it returns to generate the next node.  Failure to do so means that region values returned that don't require the state to be modified will get ignored.
      
      MemRegion:
      - Tighten the interface for ElementRegion.  Now ElementRegion can only be created with a super region that is a 'TypedRegion' instead of any MemRegion.  Code in BasicStoreManager/RegionStoreManager already assumed this, but it would result in a dynamic assertion check (and crash) rather than just having the compiler forbid the construction of such regions.
      - Added ElementRegion::getArrayRegion() to return the 'typed version' of an ElementRegion's super region.
      - Removed bogus assertion in ElementRegion::getType() that assumed that the super region was an AnonTypedRegion.  All that matters is that it is a TypedRegion, which is now true all the time by design.
      
      BasicStore:
      - Modified getLValueElement() to check if the 'array' region is a TypedRegion before creating an ElementRegion.  This conforms to the updated interface for ElementRegion.
      
      RegionStore:
      - In ArrayToPointer() gracefully handle things we don't reason about, and only create an ElementRegion if the array region is indeed a TypedRegion.
      
      llvm-svn: 60990
      f065b15f
  8. Dec 11, 2008
  9. Dec 10, 2008
  10. Dec 09, 2008
  11. Dec 08, 2008
  12. Dec 06, 2008
  13. Dec 05, 2008
  14. Dec 04, 2008
  15. Dec 03, 2008
    • Ted Kremenek's avatar
      BasicConstraintManager: · fff9f4aa
      Ted Kremenek authored
      - Fix nonsensical logic in AssumeSymGE. When comparing 'sym >= constant' and the
        constant is the maximum integer value, add the constraint that 'sym ==
        constant' when the path is deemed feasible.  All other cases are feasible.
      - Improve AssumeSymGT. When comparing 'sym > constant' and constant is the
        maximum integer value we know the path is infeasible.
      - Add test case for this enhancement to AssumeSymGT.
      
      llvm-svn: 60490
      fff9f4aa
    • Ted Kremenek's avatar
      BasicConstraintManager: · f935cfe2
      Ted Kremenek authored
      - Fix nonsensical logic in AssumeSymLE. When comparing 'sym <= constant' and the
        constant is the minimum integer value, add the constraint that 'sym ==
        constant' when the path is deemed feasible.  All other cases are feasible.
      - Improve AssumeSymLT to address <rdar://problem/6407949>.  When comparing
        'sym < constant' and constant is the minimum integer value we know the
        path is infeasible.
      - Add test case for <rdar://problem/6407949>.
      
      llvm-svn: 60489
      f935cfe2
  16. Dec 02, 2008
  17. Nov 30, 2008
  18. Nov 29, 2008
  19. Nov 28, 2008
    • Zhongxing Xu's avatar
      Fix a serious bug. · e31a8ebf
      Zhongxing Xu authored
      When initialized, the index of the ElementRegion was unsigned. But the index
      value of the ArraySubscriptExpr is signed. This inconsistency caused the value
      of the array element retrieved to be UnknownVal despite it was initialized to
      symbolic.
      
      This is only a hack. Real fix of this problem is required.
      
      llvm-svn: 60207
      e31a8ebf
Loading