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

Unified Diff: src/parser.cc

Issue 199583006: Increase the "local variables in a function" limit by a huge amount. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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/parser.h ('k') | test/mjsunit/limit-locals.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 0d1ba004b5862a9c6a560f0abeeca769a151ef35..22ac5a5ca1e617db0a0879ee8e5c2c2fde7e70b4 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -2094,7 +2094,9 @@ Block* Parser::ParseVariableDeclarations(
factory()->NewVariableDeclaration(proxy, mode, scope_, pos);
Declare(declaration, mode != VAR, CHECK_OK);
nvars++;
- if (declaration_scope->num_var_or_const() > kMaxNumFunctionLocals) {
+ // Variable indexes are stored as ints, so we definitely cannot have more
+ // variables than we have indexes for.
+ if (declaration_scope->num_var_or_const() == kMaxInt) {
ReportMessageAt(scanner()->location(), "too_many_variables");
*ok = false;
return NULL;
« no previous file with comments | « src/parser.h ('k') | test/mjsunit/limit-locals.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698