[analyzer] Address Jordan's feedback for r167780.
llvm-svn: 167790
This commit is contained in:
parent
e6ee671e16
commit
abdc72d970
|
|
@ -191,12 +191,13 @@ void ExprEngine::removeDeadOnEndOfFunction(NodeBuilderContext& BC,
|
||||||
currBldrCtx = 0;
|
currBldrCtx = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isDifferentDeclUsedAtRuntime(CallEventRef<> Call,
|
static bool wasDifferentDeclUsedForInlining(CallEventRef<> Call,
|
||||||
const StackFrameContext *calleeCtx) {
|
const StackFrameContext *calleeCtx) {
|
||||||
const Decl *RuntimeCallee = calleeCtx->getDecl();
|
const Decl *RuntimeCallee = calleeCtx->getDecl();
|
||||||
const Decl *StaticDecl = Call->getDecl();
|
const Decl *StaticDecl = Call->getDecl();
|
||||||
if (!RuntimeCallee || !StaticDecl)
|
assert(RuntimeCallee);
|
||||||
return false;
|
if (!StaticDecl)
|
||||||
|
return true;
|
||||||
return RuntimeCallee->getCanonicalDecl() != StaticDecl->getCanonicalDecl();
|
return RuntimeCallee->getCanonicalDecl() != StaticDecl->getCanonicalDecl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -240,7 +241,7 @@ void ExprEngine::processCallExit(ExplodedNode *CEBNode) {
|
||||||
SVal V = state->getSVal(RS, LCtx);
|
SVal V = state->getSVal(RS, LCtx);
|
||||||
|
|
||||||
// Ensure that the return type matches the type of the returned Expr.
|
// Ensure that the return type matches the type of the returned Expr.
|
||||||
if (isDifferentDeclUsedAtRuntime(Call, calleeCtx)) {
|
if (wasDifferentDeclUsedForInlining(Call, calleeCtx)) {
|
||||||
QualType ReturnedTy =
|
QualType ReturnedTy =
|
||||||
CallEvent::getDeclaredResultType(calleeCtx->getDecl());
|
CallEvent::getDeclaredResultType(calleeCtx->getDecl());
|
||||||
if (!ReturnedTy.isNull()) {
|
if (!ReturnedTy.isNull()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue