aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Interp.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-09-12 07:12:09 +0200
committerGitHub <noreply@github.com>2025-09-12 07:12:09 +0200
commitfefe670be067cd698a71ab8dcd6a92803e2192ef (patch)
tree3fded6f85943f67a4ee5d7b7d6f7a31c84981c1c /clang/lib/AST/ByteCode/Interp.cpp
parentaef2f41f3fdc12d40db244e61fbe812db5612dda (diff)
downloadllvm-fefe670be067cd698a71ab8dcd6a92803e2192ef.zip
llvm-fefe670be067cd698a71ab8dcd6a92803e2192ef.tar.gz
llvm-fefe670be067cd698a71ab8dcd6a92803e2192ef.tar.bz2
[clang][bytecode] Compile the definition, not the most recent decl (#158093)
Diffstat (limited to 'clang/lib/AST/ByteCode/Interp.cpp')
-rw-r--r--clang/lib/AST/ByteCode/Interp.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index b961a41..d5e75a0 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -1493,9 +1493,12 @@ bool CheckDestructor(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
}
static void compileFunction(InterpState &S, const Function *Func) {
+ const FunctionDecl *Definition = Func->getDecl()->getDefinition();
+ if (!Definition)
+ return;
+
Compiler<ByteCodeEmitter>(S.getContext(), S.P)
- .compileFunc(Func->getDecl()->getMostRecentDecl(),
- const_cast<Function *>(Func));
+ .compileFunc(Definition, const_cast<Function *>(Func));
}
bool CallVar(InterpState &S, CodePtr OpPC, const Function *Func,