Skip to content

Commit b37bd78

Browse files
committed
[clang][Interp][NFC] Add missing special cases for implicit functions
We have this special case in getSource() and getRange(), but we were missing it in getExpr() and getLocation().
1 parent a50bd0d commit b37bd78

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clang/lib/AST/Interp/InterpFrame.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,16 @@ SourceInfo InterpFrame::getSource(CodePtr PC) const {
228228
}
229229

230230
const Expr *InterpFrame::getExpr(CodePtr PC) const {
231+
if (Func && (!Func->hasBody() || Func->getDecl()->isImplicit()) && Caller)
232+
return Caller->getExpr(RetPC);
233+
231234
return S.getExpr(Func, PC);
232235
}
233236

234237
SourceLocation InterpFrame::getLocation(CodePtr PC) const {
238+
if (Func && (!Func->hasBody() || Func->getDecl()->isImplicit()) && Caller)
239+
return Caller->getLocation(RetPC);
240+
235241
return S.getLocation(Func, PC);
236242
}
237243

0 commit comments

Comments
 (0)