aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-11-14 04:43:10 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-11-14 04:43:10 +0000
commit3e42ffd3a848236413caa799f1f32a87fd6d702b (patch)
tree2559ab9e49db3bc736105f5641e2a2834bad2510 /lib/Sema
parent73dd7686d68fec7b5d7faa6d230be23ccfd9c41f (diff)
PR5462: Don't run off the edge of the argument array for vararg handling
when there are more parameters in the prototype than arguments to the call. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88759 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index f20b37d90c..b311fda2d3 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -2679,7 +2679,7 @@ Sema::ConvertArgumentsForCall(CallExpr *Call, Expr *Fn,
CallType = VariadicMethod;
// Promote the arguments (C99 6.5.2.2p7).
- for (unsigned i = NumArgsInProto; i != NumArgs; i++) {
+ for (unsigned i = NumArgsInProto; i < NumArgs; i++) {
Expr *Arg = Args[i];
Invalid |= DefaultVariadicArgumentPromotion(Arg, CallType);
Call->setArg(i, Arg);