Skip to content

Commit 5405ba5

Browse files
authored
[clang][bytecode] Check ia32_{pext,pdep} builtins for integer args (llvm#113091)
1 parent 8673d0e commit 5405ba5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,10 @@ static bool interp__builtin_ia32_pdep(InterpState &S, CodePtr OpPC,
13311331
const InterpFrame *Frame,
13321332
const Function *Func,
13331333
const CallExpr *Call) {
1334+
if (!Call->getArg(0)->getType()->isIntegerType() ||
1335+
!Call->getArg(1)->getType()->isIntegerType())
1336+
return false;
1337+
13341338
PrimType ValT = *S.Ctx.classify(Call->getArg(0));
13351339
PrimType MaskT = *S.Ctx.classify(Call->getArg(1));
13361340

@@ -1352,6 +1356,10 @@ static bool interp__builtin_ia32_pext(InterpState &S, CodePtr OpPC,
13521356
const InterpFrame *Frame,
13531357
const Function *Func,
13541358
const CallExpr *Call) {
1359+
if (!Call->getArg(0)->getType()->isIntegerType() ||
1360+
!Call->getArg(1)->getType()->isIntegerType())
1361+
return false;
1362+
13551363
PrimType ValT = *S.Ctx.classify(Call->getArg(0));
13561364
PrimType MaskT = *S.Ctx.classify(Call->getArg(1));
13571365

0 commit comments

Comments
 (0)