Skip to content
Snippets Groups Projects
  1. Jul 11, 2014
  2. Jul 10, 2014
    • Jordan Rose's avatar
      [analyzer] Check for code testing a variable for 0 after using it as a denominator. · 00a1ef80
      Jordan Rose authored
      This new checker, alpha.core.TestAfterDivZero, catches issues like this:
      
        int sum = ...
        int avg = sum / count; // potential division by zero...
        if (count == 0) { ... } // ...caught here
      
      Because the analyzer does not necessarily explore /all/ paths through a program,
      this check is restricted to only work on zero checks that immediately follow a
      division operation (/ % /= %=). This could later be expanded to handle checks
      dominated by a division operation but not necessarily in the same CFG block.
      
      Patch by Anders Rönnholm! (with very minor modifications by me)
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212731 91177308-0d34-0410-b5e6-96231b3b80d8
      00a1ef80
  3. Jul 05, 2014
  4. Jun 22, 2014
  5. Jun 14, 2014
  6. May 28, 2014
  7. May 27, 2014
  8. May 20, 2014
  9. May 15, 2014
  10. May 07, 2014
  11. May 06, 2014
  12. May 02, 2014
  13. Apr 22, 2014
  14. Apr 09, 2014
  15. Apr 01, 2014
  16. Mar 26, 2014
    • Jordan Rose's avatar
      [analyzer] Handle the M_ZERO and __GFP_ZERO flags in kernel mallocs. · 447549aa
      Jordan Rose authored
      Add M_ZERO awareness to malloc() static analysis in Clang for FreeBSD,
      NetBSD, and OpenBSD in a similar fashion to O_CREAT for open(2).
      These systems have a three-argument malloc() in the kernel where the
      third argument contains flags; the M_ZERO flag will zero-initialize the
      allocated buffer.
      
      This should reduce the number of false positives when running static
      analysis on BSD kernels.
      
      Additionally, add kmalloc() (Linux kernel malloc()) and treat __GFP_ZERO
      like M_ZERO on Linux.
      
      Future work involves a better method of checking for named flags without
      hardcoding values.
      
      Patch by Conrad Meyer, with minor modifications by me.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204832 91177308-0d34-0410-b5e6-96231b3b80d8
      447549aa
  17. Mar 25, 2014
    • Jordan Rose's avatar
      [analyzer] Don't track retain counts of objects directly accessed through ivars. · fa9f141c
      Jordan Rose authored
      A refinement of r198953 to handle cases where an object is accessed both through
      a property getter and through direct ivar access. An object accessed through a
      property should always be treated as +0, i.e. not owned by the caller. However,
      an object accessed through an ivar may be at +0 or at +1, depending on whether
      the ivar is a strong reference. Outside of ARC, we don't have that information,
      so we just don't track objects accessed through ivars.
      
      With this change, accessing an ivar directly will deliberately override the +0
      provided by a getter, but only if the +0 hasn't participated in other retain
      counting yet. That isn't perfect, but it's already unusual for people to be
      mixing property access with direct ivar access. (The primary use case for this
      is in setters, init methods, and -dealloc.)
      
      Thanks to Ted for spotting a few mistakes in private review.
      
      <rdar://problem/16333368>
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204730 91177308-0d34-0410-b5e6-96231b3b80d8
      fa9f141c
  18. Mar 23, 2014
    • Nuno Lopes's avatar
      remove a bunch of unused private methods · 50cd0d9d
      Nuno Lopes authored
      found with a smarter version of -Wunused-member-function that I'm playwing with.
      Appologies in advance if I removed someone's WIP code.
      
       ARCMigrate/TransProperties.cpp                  |    8 -----
       AST/MicrosoftMangle.cpp                         |    1 
       Analysis/AnalysisDeclContext.cpp                |    5 ---
       Analysis/LiveVariables.cpp                      |   14 ----------
       Index/USRGeneration.cpp                         |   10 -------
       Sema/Sema.cpp                                   |   33 +++++++++++++++++++++---
       Sema/SemaChecking.cpp                           |    3 --
       Sema/SemaDecl.cpp                               |   20 ++------------
       StaticAnalyzer/Checkers/GenericTaintChecker.cpp |    1 
       9 files changed, 34 insertions(+), 61 deletions(-)
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204561 91177308-0d34-0410-b5e6-96231b3b80d8
      50cd0d9d
  19. Mar 15, 2014
  20. Mar 14, 2014
  21. Mar 13, 2014
  22. Mar 11, 2014
  23. Mar 10, 2014
  24. Mar 08, 2014
Loading