diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-05-05 16:24:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-05 16:24:53 +0200 |
commit | d6f1de3107bb2367065cf39a6468b9466524be75 (patch) | |
tree | 2616010fec6e94753244253a8f204a92ec565928 /clang/lib/AST/ByteCode/Interp.cpp | |
parent | f33821628d0e03f5389e1f4339b4d10f6a8883b5 (diff) | |
download | llvm-d6f1de3107bb2367065cf39a6468b9466524be75.zip llvm-d6f1de3107bb2367065cf39a6468b9466524be75.tar.gz llvm-d6f1de3107bb2367065cf39a6468b9466524be75.tar.bz2 |
[clang][bytecode] Bail out on invalid function declarations (#138503)
Diffstat (limited to 'clang/lib/AST/ByteCode/Interp.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/Interp.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp index 1a7fc6c..9c041ad 100644 --- a/clang/lib/AST/ByteCode/Interp.cpp +++ b/clang/lib/AST/ByteCode/Interp.cpp @@ -834,6 +834,12 @@ bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) { return false; } + // Bail out if the function declaration itself is invalid. We will + // have produced a relevant diagnostic while parsing it, so just + // note the problematic sub-expression. + if (F->getDecl()->isInvalidDecl()) + return Invalid(S, OpPC); + if (S.checkingPotentialConstantExpression() && S.Current->getDepth() != 0) return false; |