Ignore:
Timestamp:
Feb 2, 2009, 10:08:53 PM (16 years ago)
Author:
[email protected]
Message:

<https://bugs.webkit.org/show_bug.cgi?id=21414> REGRESSION: Regular Expressions and character classes, shorthands and ranges
<rdar://problem/6543487>

Reviewed by Gavin Barraclough.

In certain circumstances when WREC::Generator::generateCharacterClassInvertedRange invokes
itself recursively, it will incorrectly emit (and thus consume) the next single character
match in the current character class. As WREC uses a binary search this out of sequence
codegen could result in a character match being missed and so cause the regex to produce
incorrect results.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wrec/WRECGenerator.cpp

    r39371 r40522  
    364364                generateCharacterClassInvertedRange(failures, matchDest, ranges, which, matchIndex, matches, matchCount);
    365365           
    366             do {
     366            while ((*matchIndex < matchCount) && (matches[*matchIndex] < lo)) {
    367367                matchDest.append(je32(character, Imm32((unsigned short)matches[*matchIndex])));
    368368                ++*matchIndex;
    369             } while ((*matchIndex < matchCount) && (matches[*matchIndex] < lo));
     369            }
    370370            failures.append(jump());
    371371
Note: See TracChangeset for help on using the changeset viewer.