Skip to content
Snippets Groups Projects
  1. Apr 13, 2017
  2. Jan 13, 2017
  3. Dec 19, 2016
    • Devin Coughlin's avatar
      [analyzer] Add sink after construction of temporary with no-return destructor. · 3efe802b
      Devin Coughlin authored
      The analyzer's CFG currently doesn't have nodes for calls to temporary
      destructors. This causes the analyzer to explore infeasible paths in which
      a no-return destructor would have stopped exploration and so results in false
      positives when no-return destructors are used to implement assertions.
      
      To mitigate these false positives, this patch stops generates a sink after
      evaluating a constructor on a temporary object that has a no-return destructor.
      This results in a loss of coverage because the time at which the destructor is
      called may be after the time of construction (especially for lifetime-extended
      temporaries).
      
      This addresses PR15599.
      
      rdar://problem/29131566
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290140 91177308-0d34-0410-b5e6-96231b3b80d8
      3efe802b
  4. Oct 31, 2016
  5. Sep 01, 2016
  6. Dec 17, 2015
    • Devin Coughlin's avatar
      [analyzer] Better detect when C++ object was constructed into existing region. · d4ba9bd2
      Devin Coughlin authored
      When the analyzer evaluates a CXXConstructExpr, it looks ahead in the CFG for
      the current block to detect what region the object should be constructed into.
      If the constructor was directly constructed into a local variable or field
      region then there is no need to explicitly bind the constructed value to
      the local or field when analyzing the DeclStmt or CXXCtorInitializer that
      called the constructor.
      
      Unfortunately, there were situations in which the CXXConstructExpr was
      constructed into a temporary region but when evaluating the corresponding
      DeclStmt or CXXCtorInitializer the analyzer assumed the object was constructed
      into the local or field. This led to spurious warnings about uninitialized
      values (PR25777).
      
      To avoid these false positives, this commit factors out the logic for
      determining when a CXXConstructExpr will be directly constructed into existing
      storage, adds the inverse logic to detect when the corresponding later bind can
      be safely skipped, and adds assertions to make sure these two checks are in
      sync.
      
      rdar://problem/21947725
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255859 91177308-0d34-0410-b5e6-96231b3b80d8
      d4ba9bd2
  7. Dec 08, 2015
  8. Sep 11, 2015
  9. Sep 08, 2015
  10. May 27, 2014
  11. Apr 29, 2014
  12. Apr 05, 2014
  13. Apr 01, 2014
  14. Feb 11, 2014
  15. Sep 25, 2013
    • Jordan Rose's avatar
      [analyzer] Handle destructors for the argument to C++ 'delete'. · 81557223
      Jordan Rose authored
      Now that the CFG includes nodes for the destructors in a delete-expression,
      process them in the analyzer using the same common destructor interface
      currently used for local, member, and base destructors. Also, check for when
      the value is known to be null, in which case no destructor is actually run.
      
      This does not yet handle destructors for deleted /arrays/, which may need
      more CFG work. It also causes a slight regression in the location of
      double delete warnings; the double delete is detected at the destructor
      call, which is implicit, and so is reported on the first access within the
      destructor instead of at the 'delete' statement. This will be fixed soon.
      
      Patch by Karthik Bhat!
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191381 91177308-0d34-0410-b5e6-96231b3b80d8
      81557223
  16. Sep 02, 2013
    • Pavel Labath's avatar
      [analyzer] Add very limited support for temporary destructors · 95ab9e30
      Pavel Labath authored
      This is an improved version of r186498. It enables ExprEngine to reason about
      temporary object destructors.  However, these destructor calls are never
      inlined, since this feature is still broken. Still, this is sufficient to
      properly handle noreturn temporary destructors.
      
      Now, the analyzer correctly handles expressions like "a || A()", and executes the
      destructor of "A" only on the paths where "a" evaluted to false.
      
      Temporary destructor processing is still off by default and one has to
      explicitly request it by setting cfg-temporary-dtors=true.
      
      Reviewers: jordan_rose
      
      CC: cfe-commits
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D1259
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189746 91177308-0d34-0410-b5e6-96231b3b80d8
      95ab9e30
  17. Aug 28, 2013
  18. Jul 26, 2013
    • Jordan Rose's avatar
      [analyzer] Remove dead optimization for MaterializeTemporaryExpr. · b2c405eb
      Jordan Rose authored
      Previously, we tried to avoid creating new temporary object regions if
      the value to be materialized itself came from a temporary object region.
      However, once we became more strict about lvalues vs. rvalues (months
      ago), this optimization became dead code, because the input to this
      function will always be an rvalue (i.e. a symbolic value or compound
      value rather than a region, at least for structs).
      
      This would be a nice optimization to keep, but removing it makes it
      simpler to reason about temporary regions.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187160 91177308-0d34-0410-b5e6-96231b3b80d8
      b2c405eb
  19. Jul 10, 2013
  20. Jun 25, 2013
    • Jordan Rose's avatar
      [analyzer] Handle zeroing CXXConstructExprs. · be35df19
      Jordan Rose authored
      Re-apply r184511, reverted in r184561, with the trivial default constructor
      fast path removed -- it turned out not to be necessary here.
      
      Certain expressions can cause a constructor invocation to zero-initialize
      its object even if the constructor itself does no initialization. The
      analyzer now handles that before evaluating the call to the constructor,
      using the same "default binding" mechanism that calloc() uses, rather
      than simply ignoring the zero-initialization flag.
      
      <rdar://problem/14212563>
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184815 91177308-0d34-0410-b5e6-96231b3b80d8
      be35df19
    • Jordan Rose's avatar
      [analyzer] Don't initialize virtual base classes more than once. · 1fc9111d
      Jordan Rose authored
      In order to make sure virtual base classes are always initialized once,
      the AST contains initializers for the base class in /all/ of its
      descendents, not just the immediate descendents. However, at runtime,
      the most-derived object is responsible for initializing all the virtual
      base classes; all the other initializers will be ignored.
      
      The analyzer now checks to see if it's being called from another base
      constructor, and if so does not perform virtual base initialization.
      
      <rdar://problem/14236851>
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184814 91177308-0d34-0410-b5e6-96231b3b80d8
      1fc9111d
  21. Jun 21, 2013
  22. Apr 03, 2013
  23. Mar 30, 2013
  24. Mar 28, 2013
  25. Mar 27, 2013
  26. Mar 16, 2013
  27. Feb 26, 2013
    • Jordan Rose's avatar
      [analyzer] Don't look through casts when creating pointer temporaries. · eafb5c69
      Jordan Rose authored
      Normally, we need to look through derived-to-base casts when creating
      temporary object regions (added in r175854). However, if the temporary
      is a pointer (rather than a struct/class instance), we need to /preserve/
      the base casts that have been applied.
      
      This also ensures that we really do create a new temporary region when
      we need to: MaterializeTemporaryExpr and lvalue CXXDefaultArgExprs.
      
      Fixes PR15342, although the test case doesn't include the crash because
      I couldn't isolate it.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176069 91177308-0d34-0410-b5e6-96231b3b80d8
      eafb5c69
  28. Feb 23, 2013
    • David Blaikie's avatar
      Remove the CFGElement "Invalid" state. · b0780548
      David Blaikie authored
      Use Optional<CFG*> where invalid states were needed previously. In the one case
      where that's not possible (beginAutomaticObjDtorsInsert) just use a dummy
      CFGAutomaticObjDtor.
      
      Thanks for the help from Jordan Rose & discussion/feedback from Ted Kremenek
      and Doug Gregor.
      
      Post commit code review feedback on r175796 by Ted Kremenek.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175938 91177308-0d34-0410-b5e6-96231b3b80d8
      b0780548
  29. Feb 22, 2013
    • Jordan Rose's avatar
      [analyzer] Make sure a materialized temporary matches its bindings. · 5e5440ba
      Jordan Rose authored
      This is a follow-up to r175830, which made sure a temporary object region
      created for, say, a struct rvalue matched up with the initial bindings
      being stored into it. This does the same for the case in which the AST
      actually tells us that we need to create a temporary via a
      MaterializeObjectExpr. I've unified the two code paths and moved a static
      helper function onto ExprEngine.
      
      This also caused a bit of test churn, causing us to go back to describing
      temporary regions without a 'const' qualifier. This seems acceptable; it's
      our behavior from a few months ago.
      
      <rdar://problem/13265460> (part 2)
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175854 91177308-0d34-0410-b5e6-96231b3b80d8
      5e5440ba
  30. Feb 21, 2013
  31. Feb 20, 2013
  32. Feb 15, 2013
  33. Feb 02, 2013
  34. Feb 01, 2013
Loading