aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorAlex Bradbury <asb@igalia.com>2022-04-20 14:28:42 +0100
committerAlex Bradbury <asb@igalia.com>2022-04-20 14:42:41 +0100
commitbea5e88bcf5908b676da35fb8c64f9f8449ba73b (patch)
treefe97937538c1c85e7b4d99dc633bdab4d7f5e64b /clang/lib/Sema/SemaChecking.cpp
parent95f0f69441fb8b33528d25ba2b40e3fa703c6ea5 (diff)
downloadllvm-bea5e88bcf5908b676da35fb8c64f9f8449ba73b.zip
llvm-bea5e88bcf5908b676da35fb8c64f9f8449ba73b.tar.gz
llvm-bea5e88bcf5908b676da35fb8c64f9f8449ba73b.tar.bz2
[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.
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index cd069d5..f575c07 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -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;