Skip to content
  1. Dec 01, 2012
  2. Nov 29, 2012
  3. Nov 28, 2012
  4. Nov 26, 2012
    • Anna Zaks's avatar
      [analyzer] Fix a crash reported in PR 14400. · e3beeaa5
      Anna Zaks authored
      The AllocaRegion did not have the superRegion (based on LocationContext)
      as part of it's hash. As a consequence, the AllocaRegions from
      different frames were uniqued to be the same region.
      
      llvm-svn: 168599
      e3beeaa5
  5. Nov 22, 2012
  6. Nov 15, 2012
    • Jordan Rose's avatar
      [analyzer] Fix a use-after-free introduced in r168019. · 19bc88c3
      Jordan Rose authored
      In code like this:
      
      void foo() {
           bar();
           baz();
      }
      
      ...the location for the call to 'bar()' was being used as a backup location
      for the call to 'baz()'. This is fine unless the call to 'bar()' is deemed
      uninteresting and that part of the path deleted.
      
      (This looks like a logic error as well, but in practice the only way 'baz()'
      could have an invalid location is if the entire body of 'foo()' is
      synthesized, meaning the call to 'bar()' will be using the location of the
      call to 'foo()' anyway. Nevertheless, the new version better matches the
      intent of the code.)
      
      Found by Matt Beaumont-Gay using ASan. Thanks, Matt!
      
      llvm-svn: 168080
      19bc88c3
    • Jordan Rose's avatar
      [analyzer] Report leaks at the closing brace of a function body. · e37ab50a
      Jordan Rose authored
      This fixes a few cases where we'd emit path notes like this:
      
        +---+
       1|   v
        p = malloc(len);
        ^   |2
        +---+
      
      In general this should make path notes more consistent and more correct,
      especially in cases where the leak happens on the false branch of an if
      that jumps directly to the end of the function. There are a couple places
      where the leak is reported farther away from the cause; these are usually
      cases where there are several levels of nested braces before the end of
      the function. This still matches our current behavior for when there /is/
      a statement after all the braces, though.
      
      llvm-svn: 168070
      e37ab50a
    • Jordan Rose's avatar
      [analyzer] StreamChecker: Remove now-unnecessary check::EndPath callback. · b9263cf1
      Jordan Rose authored
      Also, don't bother to stop tracking symbols in the return value, either.
      They are now properly considered live during checkDeadSymbols.
      
      llvm-svn: 168069
      b9263cf1
    • Jordan Rose's avatar
      [analyzer] MacOSKeychainAPIChecker: Remove now-unnecessary check::EndPath. · 7489ba5e
      Jordan Rose authored
      Also, don't bother to stop tracking symbols in the return value, either.
      They are now properly considered live during checkDeadSymbols.
      
      llvm-svn: 168068
      7489ba5e
    • Jordan Rose's avatar
      [analyzer] MallocChecker: Remove now-unnecessary check::EndPath callback. · f1f26140
      Jordan Rose authored
      Also, don't bother to stop tracking symbols in the return value, either.
      They are now properly considered live during checkDeadSymbols.
      
      llvm-svn: 168067
      f1f26140
    • Jordan Rose's avatar
      [analyzer] Mark symbol values as dead in the environment. · b5b0fc19
      Jordan Rose authored
      This allows us to properly remove dead bindings at the end of the top-level
      stack frame, using the ReturnStmt, if there is one, to keep the return value
      live. This in turn removes the need for a check::EndPath callback in leak
      checkers.
      
      This does cause some changes in the path notes for leak checkers. Previously,
      a leak would be reported at the location of the closing brace in a function.
      Now, it gets reported at the last statement. This matches the way leaks are
      currently reported for inlined functions, but is less than ideal for both.
      
      llvm-svn: 168066
      b5b0fc19
    • Jordan Rose's avatar
      [analyzer] Make sure calls in synthesized functions have valid path locations. · 2d98b97e
      Jordan Rose authored
      We do this by using the "most recent" good location: if a synthesized
      function 'A' calls another function 'B', the path notes for the call to 'B'
      will be placed at the same location as the path note for calling 'A'.
      
      Similarly, the call to 'A' will have a note saying "Entered call from...",
      and now we just don't emit that (since the user doesn't have a body to look
      at anyway).
      
      Previously, we were doing this for the "Calling..." notes, but not for the
      "Entered call from..." or "Returning to caller". This caused a crash when
      the path entered and then exiting a call within a synthesized body.
      
      <rdar://problem/12657843>
      
      llvm-svn: 168019
      2d98b97e
  7. Nov 13, 2012
  8. Nov 12, 2012
  9. Nov 10, 2012
    • Jordan Rose's avatar
      [analyzer] When invalidating symbolic offset regions, take fields into account. · 9eb409ac
      Jordan Rose authored
      Previously, RegionStore was being VERY conservative in saying that because
      p[i].x and p[i].y have a concrete base region of 'p', they might overlap.
      Now, we check the chain of fields back up to the base object and check if
      they match.
      
      This only kicks in when dealing with symbolic offset regions because
      RegionStore's "base+offset" representation of concrete offset regions loses
      all information about fields. In cases where all offsets are concrete
      (s.x and s.y), RegionStore will already do the right thing, but mixing
      concrete and symbolic offsets can cause bindings to be invalidated that
      are known to not overlap (e.g. p[0].x and p[i].y).
      This additional refinement is tracked by <rdar://problem/12676180>.
      
      <rdar://problem/12530149>
      
      llvm-svn: 167654
      9eb409ac
  10. Nov 07, 2012
  11. Nov 06, 2012
  12. Nov 05, 2012
    • Jordan Rose's avatar
      [analyzer] Move convenience REGISTER_*_WITH_PROGRAMSTATE to CheckerContext.h · 520a30fd
      Jordan Rose authored
      As Anna pointed out, ProgramStateTrait.h is a relatively obscure header,
      and checker writers may not know to look there to add their own custom
      state.
      
      The base macro that specializes the template remains in ProgramStateTrait.h
      (REGISTER_TRAIT_WITH_PROGRAMSTATE), which allows the analyzer core to keep
      using it.
      
      llvm-svn: 167385
      520a30fd
  13. Nov 03, 2012
  14. Nov 02, 2012
  15. Nov 01, 2012
Loading