Skip to content
  1. Jan 06, 2012
    • Ted Kremenek's avatar
      [analyzer] Make the entries in 'Environment' context-sensitive by making entries map from · 632e3b7e
      Ted Kremenek authored
      (Stmt*,LocationContext*) pairs to SVals instead of Stmt* to SVals.
      
      This is needed to support basic IPA via inlining.  Without this, we cannot tell
      if a Stmt* binding is part of the current analysis scope (StackFrameContext) or
      part of a parent context.
      
      This change introduces an uglification of the use of getSVal(), and thus takes
      two steps forward and one step back.  There are also potential performance implications
      of enlarging the Environment.  Both can be addressed going forward by refactoring the
      APIs and optimizing the internal representation of Environment.  This patch
      mainly introduces the functionality upon when we want to build upon (and clean up).
      
      llvm-svn: 147688
      632e3b7e
  2. Jan 05, 2012
    • Anna Zaks's avatar
      [analyzer] Be less pessimistic about invalidation of global variables · 8158ef0d
      Anna Zaks authored
      as a result of a call.
      
      Problem:
      Global variables, which come in from system libraries should not be
      invalidated by all calls. Also, non-system globals should not be
      invalidated by system calls.
      
      Solution:
      The following solution to invalidation of globals seems flexible enough
      for taint (does not invalidate stdin) and should not lead to too
      many false positives. We split globals into 3 classes:
      
      * immutable - values are preserved by calls (unless the specific
      global is passed in as a parameter):
           A :  Most system globals and const scalars
      
      * invalidated by functions defined in system headers:
           B: errno
      
      * invalidated by all other functions (note, these functions may in
      turn contain system calls):
           B: errno
           C: all other globals (which are not in A nor B)
      
      llvm-svn: 147569
      8158ef0d
    • Ted Kremenek's avatar
      Fix 80 col violations. · 778d2bb8
      Ted Kremenek authored
      llvm-svn: 147566
      778d2bb8
  3. Jan 04, 2012
  4. Dec 29, 2011
  5. Dec 28, 2011
  6. Dec 23, 2011
  7. Dec 22, 2011
  8. Dec 20, 2011
  9. Dec 17, 2011
  10. Dec 16, 2011
  11. Dec 15, 2011
  12. Dec 14, 2011
  13. Dec 11, 2011
    • Anna Zaks's avatar
      [analyzer] CStringChecker should not rely on the analyzer generating... · 7c96b7db
      Anna Zaks authored
      [analyzer] CStringChecker should not rely on the analyzer generating UndefOrUnknown value when it cannot reason about the expression.
      
      We are now often generating expressions even if the solver is not known to be able to simplify it. This is another cleanup of the existing code, where the rest of the analyzer and checkers should not base their logic on knowing ahead of the time what the solver can reason about. 
      
      In this case, CStringChecker is performing a check for overflow of 'left+right' operation. The overflow can be checked with either 'maxVal-left' or 'maxVal-right'. Previously, the decision was based on whether the expresion evaluated to undef or not. With this patch, we check if one of the arguments is a constant, in which case we know that 'maxVal-const' is easily simplified. (Another option is to use canReasonAbout() method of the solver here, however, it's currently is protected.)
      
      This patch also contains 2 small bug fixes:
       - swap the order of operators inside SValBuilder::makeGenericVal.
       - handle a case when AddeVal is unknown in GenericTaintChecker::getPointedToSymbol.
      
      llvm-svn: 146343
      7c96b7db
    • Anna Zaks's avatar
      [analyzer]Fixup r146336. · 170fdf1b
      Anna Zaks authored
      Forgot to commit the Header files. 
      Rename generateUnknownVal -> makeGenericVal.
      
      llvm-svn: 146337
      170fdf1b
    • Anna Zaks's avatar
      [analyzer] Introduce IntSymExpr, where the integer is on the lhs. · ecd73008
      Anna Zaks authored
      Fix a bug in SimpleSValBuilder, where we should swap lhs and rhs when calling generateUnknownVal(), - the function which creates symbolic expressions when data is tainted. The issue is not visible when we only create the expressions for taint since all expressions are commutative from taint perspective.
      
      Refactor SymExpr::symbol_iterator::expand() to use a switch instead of a chain of ifs.
      
      llvm-svn: 146336
      ecd73008
  14. Dec 09, 2011
  15. Dec 08, 2011
  16. Dec 07, 2011
  17. Dec 05, 2011
Loading