forked from OSchip/llvm-project
[clang][Sema] Fix typo in checkBuiltinArgument helper
The checkBuiltinArgument helper takes an integer ArgIndex and is documented as performing normal type-checking on that argument. However, it mistakenly hardcodes the argument index to zero when retrieving the argument from the call expression. This hadn't been noticed previously as all in-tree uses typecheck the 0th argument anyway.
This commit is contained in:
parent
95f0f69441
commit
bea5e88bcf
|
@ -6222,7 +6222,7 @@ static bool checkBuiltinArgument(Sema &S, CallExpr *E, unsigned ArgIndex) {
|
|||
InitializedEntity Entity =
|
||||
InitializedEntity::InitializeParameter(S.Context, Param);
|
||||
|
||||
ExprResult Arg = E->getArg(0);
|
||||
ExprResult Arg = E->getArg(ArgIndex);
|
||||
Arg = S.PerformCopyInitialization(Entity, SourceLocation(), Arg);
|
||||
if (Arg.isInvalid())
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue