| 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;
|
|
|