Skip to content

Commit e947bb4

Browse files
committed
[clang][bytecode] Check ia32_{pext,pdep} builtins for integer args
1 parent 490b7d1 commit e947bb4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,9 @@ 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)->isIntegerType() || !Call->getArg(1)->isIntegerType())
1335+
return false;
1336+
13341337
PrimType ValT = *S.Ctx.classify(Call->getArg(0));
13351338
PrimType MaskT = *S.Ctx.classify(Call->getArg(1));
13361339

@@ -1352,6 +1355,9 @@ static bool interp__builtin_ia32_pext(InterpState &S, CodePtr OpPC,
13521355
const InterpFrame *Frame,
13531356
const Function *Func,
13541357
const CallExpr *Call) {
1358+
if (!Call->getArg(0)->isIntegerType() || !Call->getArg(1)->isIntegerType())
1359+
return false;
1360+
13551361
PrimType ValT = *S.Ctx.classify(Call->getArg(0));
13561362
PrimType MaskT = *S.Ctx.classify(Call->getArg(1));
13571363

0 commit comments

Comments
 (0)