diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp index b8c4ef2f48a79..14e716daa3f12 100644 --- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp +++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp @@ -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 ReturnT = S.getContext().classify(Call);