diff options
author | Anna Zaks <ganna@apple.com> | 2012-06-01 23:48:40 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-06-01 23:48:40 +0000 |
commit | 1b37ea0a5fd0e4a3cc6187644de9f5e5ad8b7e7a (patch) | |
tree | c9be5a8c5abc413eb89219385058b570da892cd0 /clang | |
parent | 847075607f536d5a2304880785825775ffe76d3b (diff) | |
download | bcm5719-llvm-1b37ea0a5fd0e4a3cc6187644de9f5e5ad8b7e7a.tar.gz bcm5719-llvm-1b37ea0a5fd0e4a3cc6187644de9f5e5ad8b7e7a.zip |
[analyzer] Fix lack of coverage after empty inlined function.
We should not stop exploring the path after we return from an empty
function.
llvm-svn: 157859
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp | 2 | ||||
-rw-r--r-- | clang/test/Analysis/coverage.c | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp index cab812ffdcf..a3486e7fbfd 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp @@ -159,6 +159,8 @@ void ExprEngine::processCallExit(ExplodedNode *CEBNode) { removeDead(BindedRetNode, CleanedNodes, 0, callerCtx, LastSt, ProgramPoint::PostStmtPurgeDeadSymbolsKind); currentBuilderContext = 0; + } else { + CleanedNodes.Add(CEBNode); } for (ExplodedNodeSet::iterator I = CleanedNodes.begin(), diff --git a/clang/test/Analysis/coverage.c b/clang/test/Analysis/coverage.c index 73d78da1864..811691391eb 100644 --- a/clang/test/Analysis/coverage.c +++ b/clang/test/Analysis/coverage.c @@ -92,3 +92,11 @@ void coverage9(int *x) { function_which_gives_up_settonull(&x); y = (*x); // no warning } + +static void empty_function(){ +} +int use_empty_function(int x) { + x = 0; + empty_function(); + return 5/x; //expected-warning {{Division by zero}} +} |