@@ -1254,7 +1254,7 @@ static bool interp__builtin_ia32_bextr(InterpState &S, CodePtr OpPC,
1254
1254
const InterpFrame *Frame,
1255
1255
const Function *Func,
1256
1256
const CallExpr *Call) {
1257
- if (!Call->getArg (0 )->getType ()->isIntegerType () ||
1257
+ if (Call-> getNumArgs () != 2 || !Call->getArg (0 )->getType ()->isIntegerType () ||
1258
1258
!Call->getArg (1 )->getType ()->isIntegerType ())
1259
1259
return false ;
1260
1260
@@ -1286,7 +1286,9 @@ static bool interp__builtin_ia32_bzhi(InterpState &S, CodePtr OpPC,
1286
1286
const Function *Func,
1287
1287
const CallExpr *Call) {
1288
1288
QualType CallType = Call->getType ();
1289
- if (!CallType->isIntegerType ())
1289
+ if (Call->getNumArgs () != 2 || !Call->getArg (0 )->getType ()->isIntegerType () ||
1290
+ !Call->getArg (1 )->getType ()->isIntegerType () ||
1291
+ !CallType->isIntegerType ())
1290
1292
return false ;
1291
1293
1292
1294
PrimType ValT = *S.Ctx .classify (Call->getArg (0 ));
@@ -1311,7 +1313,8 @@ static bool interp__builtin_ia32_lzcnt(InterpState &S, CodePtr OpPC,
1311
1313
const Function *Func,
1312
1314
const CallExpr *Call) {
1313
1315
QualType CallType = Call->getType ();
1314
- if (!CallType->isIntegerType ())
1316
+ if (!CallType->isIntegerType () ||
1317
+ !Call->getArg (0 )->getType ()->isIntegerType ())
1315
1318
return false ;
1316
1319
1317
1320
APSInt Val = peekToAPSInt (S.Stk , *S.Ctx .classify (Call->getArg (0 )));
@@ -1324,7 +1327,8 @@ static bool interp__builtin_ia32_tzcnt(InterpState &S, CodePtr OpPC,
1324
1327
const Function *Func,
1325
1328
const CallExpr *Call) {
1326
1329
QualType CallType = Call->getType ();
1327
- if (!CallType->isIntegerType ())
1330
+ if (!CallType->isIntegerType () ||
1331
+ !Call->getArg (0 )->getType ()->isIntegerType ())
1328
1332
return false ;
1329
1333
1330
1334
APSInt Val = peekToAPSInt (S.Stk , *S.Ctx .classify (Call->getArg (0 )));
@@ -1336,7 +1340,7 @@ static bool interp__builtin_ia32_pdep(InterpState &S, CodePtr OpPC,
1336
1340
const InterpFrame *Frame,
1337
1341
const Function *Func,
1338
1342
const CallExpr *Call) {
1339
- if (!Call->getArg (0 )->getType ()->isIntegerType () ||
1343
+ if (Call-> getNumArgs () != 2 || !Call->getArg (0 )->getType ()->isIntegerType () ||
1340
1344
!Call->getArg (1 )->getType ()->isIntegerType ())
1341
1345
return false ;
1342
1346
@@ -1361,7 +1365,7 @@ static bool interp__builtin_ia32_pext(InterpState &S, CodePtr OpPC,
1361
1365
const InterpFrame *Frame,
1362
1366
const Function *Func,
1363
1367
const CallExpr *Call) {
1364
- if (!Call->getArg (0 )->getType ()->isIntegerType () ||
1368
+ if (Call-> getNumArgs () != 2 || !Call->getArg (0 )->getType ()->isIntegerType () ||
1365
1369
!Call->getArg (1 )->getType ()->isIntegerType ())
1366
1370
return false ;
1367
1371
0 commit comments