[cfe-dev] [analyzer] "runCheckersForEndFunction()" is not guaranteed to be called at the end of each path?

Henry Wong via cfe-dev cfe-dev at lists.llvm.org
Fri Nov 3 02:02:10 PDT 2017

Hi all,
"runCheckersForEndFunction()" is called after "removeDeadOnEndOfFunction()" call, see https://github.com/llvm-mirror/clang/blob/master/lib/StaticAnalyzer/Core/ExprEngine.cpp#L1948. "removeDeadOnEndOfFunction()" calls "getNode()", and "getNode()"supports node deduplication, so the "Dst" is may be empty after "removeDeadOnEndOfFunction(NodeBuilder, Pre, Dst)" has been executed. And "runCheckersForEndFunction()" will not be called if "Dst" set is empty.

=======================================code snippets======================================
int foo(int a, int b)
if (a && b)
return a + b;
return b;
return 0;

For the above code, "runCheckersForEndFunction()" will only be executed twice. In view of the fact that the comments of "runCheckersForEndFunction()" is "Run Checkers for end of path",  is it reasonable that "runCheckersForEndFunction()" is not called at the end of all paths?

Henry Wong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20171103/9edda663/attachment-0001.html>

More information about the cfe-dev mailing list