]> granicus.if.org Git - clang/commitdiff
[analyzer] Address Jordan's feedback for r167780.
authorAnna Zaks <ganna@apple.com>
Tue, 13 Nov 2012 00:13:44 +0000 (00:13 +0000)
committerAnna Zaks <ganna@apple.com>
Tue, 13 Nov 2012 00:13:44 +0000 (00:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167790 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp

index 2e47a9a61c7075e796dd99bdec2a4266bf2456ab..3ead0817f71b15ec42519be3852fe1f472d5f93e 100644 (file)
@@ -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()) {