Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: src/parser.cc

Issue 7054074: Limit the number of arguments in a function call to 32766. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add regression test Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/regress/regress-1122.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 41a8234c29a9f0859d406fd862502619970d56d2..cce337fb46d448b23c60f958b88d644f7cc851e0 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -3505,6 +3505,12 @@ ZoneList<Expression*>* Parser::ParseArguments(bool* ok) {
while (!done) {
Expression* argument = ParseAssignmentExpression(true, CHECK_OK);
result->Add(argument);
+ if (result->length() > kMaxNumFunctionParameters) {
+ ReportMessageAt(scanner().location(), "too_many_arguments",
+ Vector<const char*>::empty());
+ *ok = false;
+ return NULL;
+ }
done = (peek() == Token::RPAREN);
if (!done) Expect(Token::COMMA, CHECK_OK);
}
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/regress/regress-1122.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698