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

Issue 7193007: Refix issue 1472. The previous fix worked for the example in the bug (Closed)

Created:
9 years, 6 months ago by Erik Corry
Modified:
9 years, 6 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Refix issue 1472. The previous fix worked for the example in the bug report, but was not general enough to catch all cases. This is a new approach. Includes regression test! Committed: http://code.google.com/p/v8/source/detail?r=8318

Patch Set 1 #

Total comments: 3

Patch Set 2 : '' #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+123 lines, -179 lines) Patch
M src/ast.h View 1 10 chunks +1 line, -24 lines 2 comments Download
M src/ast.cc View 1 1 chunk +0 lines, -20 lines 0 comments Download
M src/jsregexp.cc View 1 7 chunks +82 lines, -135 lines 8 comments Download
A test/mjsunit/regress/regress-1472.js View 1 chunk +40 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Erik Corry
9 years, 6 months ago (2011-06-16 11:51:20 UTC) #1
Lasse Reichstein
LGTM http://codereview.chromium.org/7193007/diff/1/src/jsregexp.cc File src/jsregexp.cc (right): http://codereview.chromium.org/7193007/diff/1/src/jsregexp.cc#newcode3733 src/jsregexp.cc:3733: class RegExpExpansionLimiter { Some documentation would be nice. ...
9 years, 6 months ago (2011-06-16 12:12:47 UTC) #2
Erik Corry
9 years, 6 months ago (2011-06-16 15:26:35 UTC) #3
Erik Corry
New version uploaded
9 years, 6 months ago (2011-06-16 15:27:28 UTC) #4
Lasse Reichstein
LGTM http://codereview.chromium.org/7193007/diff/3002/src/ast.h File src/ast.h (right): http://codereview.chromium.org/7193007/diff/3002/src/ast.h#newcode213 src/ast.h:213: Expression() : id_(GetNextId()), test_id_(GetNextId()) {} What's the test_id ...
9 years, 6 months ago (2011-06-17 07:18:49 UTC) #5
Erik Corry
9 years, 6 months ago (2011-06-17 07:31:13 UTC) #6
http://codereview.chromium.org/7193007/diff/3002/src/ast.h
File src/ast.h (right):

http://codereview.chromium.org/7193007/diff/3002/src/ast.h#newcode213
src/ast.h:213: Expression() : id_(GetNextId()), test_id_(GetNextId()) {}
On 2011/06/17 07:18:49, Lasse Reichstein wrote:
> What's the test_id for?

Don't know.

http://codereview.chromium.org/7193007/diff/3002/src/jsregexp.cc
File src/jsregexp.cc (right):

http://codereview.chromium.org/7193007/diff/3002/src/jsregexp.cc#newcode3748
src/jsregexp.cc:3748: ok_to_expand_(true) {
On 2011/06/17 07:18:49, Lasse Reichstein wrote:
> How about initializing this as:
>   ok_to_expand_(saved_expansion_factor_ <= kMaxExpansionFactor)
> and not doing anything later if it's already false.

Done.

http://codereview.chromium.org/7193007/diff/3002/src/jsregexp.cc#newcode3750
src/jsregexp.cc:3750: if (factor > kMaxExpansionFactor) {
On 2011/06/17 07:18:49, Lasse Reichstein wrote:
> Add comment saying that this prevents overflow in later computation, because
> kMaxExpansionFactor^2 < kMaxInt.
> 
> Well, actually it doesn't if you have a very deep nesting of {6} quantifiers,
> because you don't cap the stored expansion_factor. Initializing ok_to_expand
as
> above, and bailing out if it's already false will prevent this.

Done.

http://codereview.chromium.org/7193007/diff/3002/src/jsregexp.cc#newcode3757
src/jsregexp.cc:3757: }
On 2011/06/17 07:18:49, Lasse Reichstein wrote:
> Remove the if and just always assing:
>  ok_to_expand = (new_factor <= kMaxExpansionFactor);

Done.

http://codereview.chromium.org/7193007/diff/3002/src/jsregexp.cc#newcode3818
src/jsregexp.cc:3818: compiler, min + ((max - min) ? 1 : 0));
On 2011/06/17 07:18:49, Lasse Reichstein wrote:
> I just noticed the using of (max - min) as a boolean. Please add a  " != 0".

max - min replaced with max != min

Powered by Google App Engine
This is Rietveld 408576698