]> granicus.if.org Git - clang/commit
Avoid double edges when constructing CFGs
authorPavel Labath <labath@google.com>
Fri, 6 Sep 2013 08:12:48 +0000 (08:12 +0000)
committerPavel Labath <labath@google.com>
Fri, 6 Sep 2013 08:12:48 +0000 (08:12 +0000)
commit1ae74842cd1be37a8d99d0865623ef16432d3b67
tree84a42c30991b8762cf49d0365b72b6e4996430b0
parentdb4813a3997fcf3864d1190f8021ef68e42cc057
Avoid double edges when constructing CFGs

Summary:
If a noreturn destructor is executed while returning a value from a function,
the resulting CFG has had two edges to the exit block. This crashed the analyzer,
because it expects that blocks with no terminators have only one outgoing edge.
I added code to avoid creating the second edge in this case.

PS: The crashes did not manifest themselves always, as usually the
NoReturnFunctionChecker would stop program evaluation before the analyzer hit
the assertion, but in the case of lifetime extended temporaries, the checker
failed to do that (which is a separate bug in itself).

Reviewers: jordan_rose

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1513

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190125 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/CFG.cpp
test/Analysis/cfg.cpp