diff options
author | Anna Zaks <ganna@apple.com> | 2012-11-13 00:13:44 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-11-13 00:13:44 +0000 |
commit | bae930d4c69a624881e66f1628ee615e149362f7 (patch) | |
tree | d2ce8dd76c090b39a65a5df77de98301079081e0 | |
parent | 8f81acfa95a5d2a22fc875c1a10901eaa30b8405 (diff) |
[analyzer] Address Jordan's feedback for r167780.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167790 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp b/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp index 2e47a9a61c..3ead0817f7 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp @@ -191,12 +191,13 @@ void ExprEngine::removeDeadOnEndOfFunction(NodeBuilderContext& BC, currBldrCtx = 0; } -static bool isDifferentDeclUsedAtRuntime(CallEventRef<> Call, +static bool wasDifferentDeclUsedForInlining(CallEventRef<> Call, const StackFrameContext *calleeCtx) { const Decl *RuntimeCallee = calleeCtx->getDecl(); const Decl *StaticDecl = Call->getDecl(); - if (!RuntimeCallee || !StaticDecl) - return false; + assert(RuntimeCallee); + if (!StaticDecl) + return true; return RuntimeCallee->getCanonicalDecl() != StaticDecl->getCanonicalDecl(); } @@ -240,7 +241,7 @@ void ExprEngine::processCallExit(ExplodedNode *CEBNode) { SVal V = state->getSVal(RS, LCtx); // Ensure that the return type matches the type of the returned Expr. - if (isDifferentDeclUsedAtRuntime(Call, calleeCtx)) { + if (wasDifferentDeclUsedForInlining(Call, calleeCtx)) { QualType ReturnedTy = CallEvent::getDeclaredResultType(calleeCtx->getDecl()); if (!ReturnedTy.isNull()) { |