@@ -1253,7 +1253,7 @@ static bool interp__builtin_ia32_bextr(InterpState &S, CodePtr OpPC,
12531253 const InterpFrame *Frame,
12541254 const Function *Func,
12551255 const CallExpr *Call) {
1256- if (!Call->getArg (0 )->getType ()->isIntegerType () ||
1256+ if (Call-> getNumArgs () != 2 || !Call->getArg (0 )->getType ()->isIntegerType () ||
12571257 !Call->getArg (1 )->getType ()->isIntegerType ())
12581258 return false ;
12591259
@@ -1285,7 +1285,9 @@ static bool interp__builtin_ia32_bzhi(InterpState &S, CodePtr OpPC,
12851285 const Function *Func,
12861286 const CallExpr *Call) {
12871287 QualType CallType = Call->getType ();
1288- if (!CallType->isIntegerType ())
1288+ if (Call->getNumArgs () != 2 || !Call->getArg (0 )->getType ()->isIntegerType () ||
1289+ !Call->getArg (1 )->getType ()->isIntegerType () ||
1290+ !CallType->isIntegerType ())
12891291 return false ;
12901292
12911293 PrimType ValT = *S.Ctx .classify (Call->getArg (0 ));
@@ -1310,7 +1312,8 @@ static bool interp__builtin_ia32_lzcnt(InterpState &S, CodePtr OpPC,
13101312 const Function *Func,
13111313 const CallExpr *Call) {
13121314 QualType CallType = Call->getType ();
1313- if (!CallType->isIntegerType ())
1315+ if (!CallType->isIntegerType () ||
1316+ !Call->getArg (0 )->getType ()->isIntegerType ())
13141317 return false ;
13151318
13161319 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,
13231326 const Function *Func,
13241327 const CallExpr *Call) {
13251328 QualType CallType = Call->getType ();
1326- if (!CallType->isIntegerType ())
1329+ if (!CallType->isIntegerType () ||
1330+ !Call->getArg (0 )->getType ()->isIntegerType ())
13271331 return false ;
13281332
13291333 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,
13351339 const InterpFrame *Frame,
13361340 const Function *Func,
13371341 const CallExpr *Call) {
1338- if (!Call->getArg (0 )->getType ()->isIntegerType () ||
1342+ if (Call-> getNumArgs () != 2 || !Call->getArg (0 )->getType ()->isIntegerType () ||
13391343 !Call->getArg (1 )->getType ()->isIntegerType ())
13401344 return false ;
13411345
@@ -1360,7 +1364,7 @@ static bool interp__builtin_ia32_pext(InterpState &S, CodePtr OpPC,
13601364 const InterpFrame *Frame,
13611365 const Function *Func,
13621366 const CallExpr *Call) {
1363- if (!Call->getArg (0 )->getType ()->isIntegerType () ||
1367+ if (Call-> getNumArgs () != 2 || !Call->getArg (0 )->getType ()->isIntegerType () ||
13641368 !Call->getArg (1 )->getType ()->isIntegerType ())
13651369 return false ;
13661370
0 commit comments