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