]> granicus.if.org Git - clang/commit
[analyzer] When we look for the last stmt in a function, skip implicit dtors.
authorJordan Rose <jordan_rose@apple.com>
Tue, 28 Aug 2012 20:52:13 +0000 (20:52 +0000)
committerJordan Rose <jordan_rose@apple.com>
Tue, 28 Aug 2012 20:52:13 +0000 (20:52 +0000)
commit632e5022f68fcae3b68bbc90538a60f3ba20229f
tree0a43cdf55be32401809988403ae64382e56240d2
parent82778af78a7337498e6bcfc81c75cee29d329915
[analyzer] When we look for the last stmt in a function, skip implicit dtors.

When exiting a function, the analyzer looks for the last statement in the
function to see if it's a return statement (and thus bind the return value).
However, the search for "the last statement" was accepting statements that
were in implicitly-generated inlined functions (i.e. destructors). So we'd
go and get the statement from the destructor, and then say "oh look, this
function had no explicit return...guess there's no return value". And /that/
led to the value being returned being declared dead, and all our leak
checkers complaining.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162791 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
test/Analysis/dtor.cpp