Author: Timm Baeder Date: 2024-10-21T08:15:51+02:00 New Revision: 615a5eb02c91ef78f59461f842873617dd187450
URL: https://github.com/llvm/llvm-project/commit/615a5eb02c91ef78f59461f842873617dd187450 DIFF: https://github.com/llvm/llvm-project/commit/615a5eb02c91ef78f59461f842873617dd187450.diff LOG: [clang][bytecode] Check ai32_bextr builtins for integer args (#113128) Added: Modified: clang/lib/AST/ByteCode/InterpBuiltin.cpp Removed: ################################################################################ diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp index c7b9dac5fec80c..10e33c14f4b455 100644 --- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp +++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp @@ -1253,6 +1253,10 @@ static bool interp__builtin_ia32_bextr(InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call) { + if (!Call->getArg(0)->getType()->isIntegerType() || + !Call->getArg(1)->getType()->isIntegerType()) + return false; + PrimType ValT = *S.Ctx.classify(Call->getArg(0)); PrimType IndexT = *S.Ctx.classify(Call->getArg(1)); APSInt Val = peekToAPSInt(S.Stk, ValT, _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits