aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index a8a9d3f..ed5d6ce 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -8025,6 +8025,17 @@ void Parser::ParseParameterDeclarationClause(
// Consume the keyword.
ConsumeToken();
}
+
+ // We can only store so many parameters
+ // Skip until the the end of the parameter list, ignoring
+ // parameters that would overflow.
+ if (ParamInfo.size() == Type::FunctionTypeNumParamsLimit) {
+ Diag(ParmDeclarator.getBeginLoc(),
+ diag::err_function_parameter_limit_exceeded);
+ SkipUntil(tok::r_paren, SkipUntilFlags::StopBeforeMatch);
+ break;
+ }
+
// Inform the actions module about the parameter declarator, so it gets
// added to the current scope.
Decl *Param =