diff --git a/clang/lib/AST/Interp/InterpFrame.cpp b/clang/lib/AST/Interp/InterpFrame.cpp index dd05dac1703fd..bf2cca733b66b 100644 --- a/clang/lib/AST/Interp/InterpFrame.cpp +++ b/clang/lib/AST/Interp/InterpFrame.cpp @@ -228,10 +228,16 @@ SourceInfo InterpFrame::getSource(CodePtr PC) const { } const Expr *InterpFrame::getExpr(CodePtr PC) const { + if (Func && (!Func->hasBody() || Func->getDecl()->isImplicit()) && Caller) + return Caller->getExpr(RetPC); + return S.getExpr(Func, PC); } SourceLocation InterpFrame::getLocation(CodePtr PC) const { + if (Func && (!Func->hasBody() || Func->getDecl()->isImplicit()) && Caller) + return Caller->getLocation(RetPC); + return S.getLocation(Func, PC); }