diff options
author | Steve Block <steveblock@google.com> | 2011-01-05 12:15:11 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-01-06 14:14:00 +0000 |
commit | d06194330da2bb8da887d2e1adeacb3a5c1504b2 (patch) | |
tree | e0af8413af65a8e30630563441af7bdb8478e513 /JavaScriptCore/yarr/RegexInterpreter.cpp | |
parent | 419a5cf2f8db6ca014df624865197ffb82caad37 (diff) | |
download | external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.zip external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.tar.gz external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.tar.bz2 |
Merge WebKit at r72805: Initial merge by Git
Note that this is a backwards merge from Chromium release 9.0.600.0
to 9.0.597.0, to align with the Chromium 9 stable release branch.
Change-Id: I5d2bb4e8cee9d39ae8485abf48bdb55ecf8b3790
Diffstat (limited to 'JavaScriptCore/yarr/RegexInterpreter.cpp')
-rw-r--r-- | JavaScriptCore/yarr/RegexInterpreter.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/JavaScriptCore/yarr/RegexInterpreter.cpp b/JavaScriptCore/yarr/RegexInterpreter.cpp index a51cd25..164158e 100644 --- a/JavaScriptCore/yarr/RegexInterpreter.cpp +++ b/JavaScriptCore/yarr/RegexInterpreter.cpp @@ -515,7 +515,8 @@ public: if (matchEnd == -1) return true; - ASSERT((matchBegin == -1) || (matchBegin <= matchEnd)); + ASSERT((matchBegin == -1) == (matchEnd == -1)); + ASSERT(matchBegin <= matchEnd); if (matchBegin == matchEnd) return true; @@ -557,7 +558,8 @@ public: int matchBegin = output[(term.atom.subpatternId << 1)]; int matchEnd = output[(term.atom.subpatternId << 1) + 1]; - ASSERT((matchBegin == -1) || (matchBegin <= matchEnd)); + ASSERT((matchBegin == -1) == (matchEnd == -1)); + ASSERT(matchBegin <= matchEnd); if (matchBegin == matchEnd) return false; @@ -717,7 +719,7 @@ public: if (term.capture()) { // Technically this access to inputPosition should be accessing the begin term's // inputPosition, but for repeats other than fixed these values should be - // the same anyway! (We don't pre-check for greedy or non-greedy matches.) + // the same anyway! (we don't pre-check for greedy or non-greedy matches.) ASSERT((&term - term.atom.parenthesesWidth)->type == ByteTerm::TypeParenthesesSubpatternOnceBegin); ASSERT((&term - term.atom.parenthesesWidth)->inputPosition == term.inputPosition); unsigned subpatternId = term.atom.subpatternId; @@ -737,7 +739,7 @@ public: { ASSERT(term.type == ByteTerm::TypeParenthesesSubpatternTerminalBegin); ASSERT(term.atom.quantityType == QuantifierGreedy); - ASSERT(term.atom.quantityCount == quantifyInfinite); + ASSERT(term.atom.quantityCount == UINT_MAX); ASSERT(!term.capture()); BackTrackInfoParenthesesTerminal* backTrack = reinterpret_cast<BackTrackInfoParenthesesTerminal*>(context->frame + term.frameLocation); @@ -763,7 +765,7 @@ public: { ASSERT(term.type == ByteTerm::TypeParenthesesSubpatternTerminalBegin); ASSERT(term.atom.quantityType == QuantifierGreedy); - ASSERT(term.atom.quantityCount == quantifyInfinite); + ASSERT(term.atom.quantityCount == UINT_MAX); ASSERT(!term.capture()); // If we backtrack to this point, we have failed to match this iteration of the parens. @@ -775,7 +777,7 @@ public: bool backtrackParenthesesTerminalEnd(ByteTerm&, DisjunctionContext*) { // 'Terminal' parentheses are at the end of the regex, and as such a match past end - // should always be returned as a successful match - we should never backtrack to here. + // should always be returned as a successful match - we should never becktrack to here. ASSERT_NOT_REACHED(); return false; } @@ -1826,7 +1828,7 @@ public: break; case PatternTerm::TypeBackReference: - atomBackReference(term.backReferenceSubpatternId, term.inputPosition - currentCountAlreadyChecked, term.frameLocation, term.quantityCount, term.quantityType); + atomBackReference(term.subpatternId, term.inputPosition - currentCountAlreadyChecked, term.frameLocation, term.quantityCount, term.quantityType); break; case PatternTerm::TypeForwardReference: |