Skip to content
  1. Apr 23, 2013
  2. Mar 20, 2013
    • Jordan Rose's avatar
      [analyzer] Don't invalidate globals when there's no call involved. · 28c68a2d
      Jordan Rose authored
      This fixes some mistaken condition logic in RegionStore that caused
      global variables to be invalidated when /any/ region was invalidated,
      rather than only as part of opaque function calls. This was only
      being used by CStringChecker, and so users will now see that strcpy()
      and friends do not invalidate global variables.
      
      Also, add a test case we don't handle properly: explicitly-assigned
      global variables aren't being invalidated by opaque calls. This is
      being tracked by <rdar://problem/13464044>.
      
      llvm-svn: 177572
      28c68a2d
  3. Mar 16, 2013
    • Anna Zaks's avatar
      [analyzer] Use isLiveRegion to determine when SymbolRegionValue is dead. · bda130f0
      Anna Zaks authored
      Fixes a FIXME, improves dead symbol collection, suppresses a false positive,
      which resulted from reusing the same symbol twice for simulation of 2 calls to the same function.
      
      Fixing this lead to 2 possible false negatives in CString checker. Since the checker is still alpha and
      the solution will not require revert of this commit, move the tests to a FIXME section.
      
      llvm-svn: 177206
      bda130f0
  4. Aug 24, 2012
  5. May 16, 2012
  6. May 14, 2012
  7. May 03, 2012
  8. Feb 20, 2012
    • Anna Zaks's avatar
      [analyzer] Turn on by default the Malloc Checker and a couple of CString · 0cdce4df
      Anna Zaks authored
      checks:
      
      - unix.Malloc - Checks for memory leaks, double free, use-after-free.
      - unix.cstring.NullArg - Checks for null pointers passed as arguments to
      CString functions + evaluates CString functions.
      - unix.cstring.BadSizeArg - Checks for common anti-patterns in
      strncat size argument.
      
      llvm-svn: 150988
      0cdce4df
  9. Feb 07, 2012
  10. Jan 31, 2012
  11. Jan 13, 2012
  12. Dec 20, 2011
    • Anna Zaks's avatar
      [analyzer] Do not invalidate arguments when the parameter's · 5f847144
      Anna Zaks authored
      type is a pointer to const. (radar://10595327)
      
      The regions corresponding to the pointer and reference arguments to
      a function get invalidated by the calls since a function call can
      possibly modify the pointed to data. With this change, we are not going
      to invalidate the data if the argument is a pointer to const. This
      change makes the analyzer more optimistic in reporting errors.
      (Support for C, C++ and Obj C)
      
      llvm-svn: 147002
      5f847144
  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
  14. Aug 04, 2011
  15. Jun 28, 2011
  16. Jun 20, 2011
  17. Jun 16, 2011
  18. Jun 15, 2011
    • Jordy Rose's avatar
      [analyzer] Revise CStringChecker's modelling of strcpy() and strcat(): · 634c12d2
      Jordy Rose authored
      - (bounded copies) Be more conservative about how much is being copied.
      - (str(n)cat) If we can't compute the exact final length of an append operation, we can still lower-bound it.
      - (stpcpy) Fix the conjured return value at the end to actually be returned.
      
      This requires these supporting changes:
      - C string metadata symbols are still live even when buried in a SymExpr.
      - "Hypothetical" C string lengths, to represent a value that /will/ be passed to setCStringLength() if all goes well. (The idea is to allow for temporary constrainable symbols that may end up becoming permanent.)
      - The 'checkAdditionOverflow' helper makes sure that the two strings being appended in a strcat don't overflow size_t. This should never *actually* happen; the real effect is to keep the final string length from "wrapping around" in the constraint manager.
      
      This doesn't actually test the "bounded" operations (strncpy and strncat) because they can leave strings unterminated. Next on the list!
      
      llvm-svn: 133046
      634c12d2
  19. Jun 14, 2011
  20. May 03, 2011
  21. May 02, 2011
  22. Apr 28, 2011
  23. Apr 26, 2011
  24. Apr 15, 2011
  25. Apr 12, 2011
  26. Apr 09, 2011
    • Lenny Maiorani's avatar
      strcat() and strncat() model additions to CStringChecker. · 467dbd5f
      Lenny Maiorani authored
      Validates inputs are not NULL, checks for overlapping strings, concatenates the strings checking for buffer overflow, sets the length of the destination string to the sum of the s1 length and the s2 length, binds the return value to the s1 value.
      
      llvm-svn: 129215
      467dbd5f
  27. Mar 24, 2011
  28. Mar 07, 2011
  29. Feb 28, 2011
  30. Feb 24, 2011
  31. Feb 22, 2011
  32. Feb 15, 2011
Loading