Skip to content

Commit f1eac77

Browse files
authored
[clang][bytecode] Check new builtins for integer types (#111801)
These might also be called with vectors, but we don't support that.
1 parent 1e49670 commit f1eac77

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,11 @@ static bool interp__builtin_ia32_addcarry_subborrow(InterpState &S,
12871287
const InterpFrame *Frame,
12881288
const Function *Func,
12891289
const CallExpr *Call) {
1290+
if (!Call->getArg(0)->getType()->isIntegerType() ||
1291+
!Call->getArg(1)->getType()->isIntegerType() ||
1292+
!Call->getArg(2)->getType()->isIntegerType())
1293+
return false;
1294+
12901295
unsigned BuiltinOp = Func->getBuiltinID();
12911296
APSInt CarryIn = getAPSIntParam(Frame, 0);
12921297
APSInt LHS = getAPSIntParam(Frame, 1);

0 commit comments

Comments
 (0)