[clang][bytecode][NFC] Bail out on non constant evaluated builtins (#130431)

If the ASTContext says so, don't bother trying to constant evaluate the
given builtin.
This commit is contained in:
Timm Baeder
2025-03-09 06:35:19 +01:00
committed by GitHub
parent 735afc8ceb
commit 227f9544a4

View File

@@ -2059,6 +2059,9 @@ static bool interp__builtin_memchr(InterpState &S, CodePtr OpPC,
bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const Function *F,
const CallExpr *Call, uint32_t BuiltinID) {
if (!S.getASTContext().BuiltinInfo.isConstantEvaluated(BuiltinID))
return false;
const InterpFrame *Frame = S.Current;
std::optional<PrimType> ReturnT = S.getContext().classify(Call);