Skip to content

Commit

Permalink
[clang][bytecode] Check new builtins for integer types (llvm#111801)
Browse files Browse the repository at this point in the history
These might also be called with vectors, but we don't support that.
  • Loading branch information
tbaederr authored and DanielCChen committed Oct 16, 2024
1 parent c3208b0 commit 555c4dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clang/lib/AST/ByteCode/InterpBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,11 @@ static bool interp__builtin_ia32_addcarry_subborrow(InterpState &S,
const InterpFrame *Frame,
const Function *Func,
const CallExpr *Call) {
if (!Call->getArg(0)->getType()->isIntegerType() ||
!Call->getArg(1)->getType()->isIntegerType() ||
!Call->getArg(2)->getType()->isIntegerType())
return false;

unsigned BuiltinOp = Func->getBuiltinID();
APSInt CarryIn = getAPSIntParam(Frame, 0);
APSInt LHS = getAPSIntParam(Frame, 1);
Expand Down

0 comments on commit 555c4dd

Please sign in to comment.