Ignore:
Timestamp:
Sep 20, 2010, 5:04:22 PM (15 years ago)
Author:
[email protected]
Message:

Fixed detection of alternative smaller than the first alternative
to only check looping alternatives.
https://bugs.webkit.org/show_bug.cgi?id=46049

Patch by Michael Saboff <[email protected]> on 2010-09-20
Reviewed by Gavin Barraclough.

  • yarr/RegexJIT.cpp:

(JSC::Yarr::RegexGenerator::generateDisjunction):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/yarr/RegexJIT.cpp

    r67867 r67894  
    12391239
    12401240        while (state.alternativeValid()) {
    1241             // Track whether any alternatives are shorter than the first one.
    1242             hasShorterAlternatives = hasShorterAlternatives || (countCheckedForCurrentAlternative < countToCheckForFirstAlternative);
    1243 
    12441241            PatternAlternative* alternative = state.alternative();
    12451242            optimizeAlternative(alternative);
    12461243
     1244            // Track whether any alternatives are shorter than the first one.
     1245            if (!alternative->onceThrough())
     1246                hasShorterAlternatives = hasShorterAlternatives || (countCheckedForCurrentAlternative < countToCheckForFirstAlternative);
     1247           
    12471248            for (state.resetTerm(); state.termValid(); state.nextTerm())
    12481249                generateTerm(state);
Note: See TracChangeset for help on using the changeset viewer.