@@ -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,7 @@ 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 () || Call-> getArg ( 0 )-> getType ()-> isIntegerType () )
1314
1316
return false ;
1315
1317
1316
1318
APSInt Val = peekToAPSInt (S.Stk , *S.Ctx .classify (Call->getArg (0 )));
@@ -1323,7 +1325,8 @@ static bool interp__builtin_ia32_tzcnt(InterpState &S, CodePtr OpPC,
1323
1325
const Function *Func,
1324
1326
const CallExpr *Call) {
1325
1327
QualType CallType = Call->getType ();
1326
- if (!CallType->isIntegerType ())
1328
+ if (!CallType->isIntegerType () ||
1329
+ !Call->getArg (0 )->getType ()->isIntegerType ())
1327
1330
return false ;
1328
1331
1329
1332
APSInt Val = peekToAPSInt (S.Stk , *S.Ctx .classify (Call->getArg (0 )));
@@ -1335,7 +1338,7 @@ static bool interp__builtin_ia32_pdep(InterpState &S, CodePtr OpPC,
1335
1338
const InterpFrame *Frame,
1336
1339
const Function *Func,
1337
1340
const CallExpr *Call) {
1338
- if (!Call->getArg (0 )->getType ()->isIntegerType () ||
1341
+ if (Call-> getNumArgs () != 2 || !Call->getArg (0 )->getType ()->isIntegerType () ||
1339
1342
!Call->getArg (1 )->getType ()->isIntegerType ())
1340
1343
return false ;
1341
1344
@@ -1360,7 +1363,7 @@ static bool interp__builtin_ia32_pext(InterpState &S, CodePtr OpPC,
1360
1363
const InterpFrame *Frame,
1361
1364
const Function *Func,
1362
1365
const CallExpr *Call) {
1363
- if (!Call->getArg (0 )->getType ()->isIntegerType () ||
1366
+ if (Call-> getNumArgs () != 2 || !Call->getArg (0 )->getType ()->isIntegerType () ||
1364
1367
!Call->getArg (1 )->getType ()->isIntegerType ())
1365
1368
return false ;
1366
1369
0 commit comments