Changeset 94207 in webkit for trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp
- Timestamp:
- Aug 31, 2011, 11:16:11 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp
r90962 r94207 512 512 { 513 513 alternative->m_hasFixedSize = true; 514 unsignedcurrentInputPosition = initialInputPosition;514 Checked<unsigned> currentInputPosition = initialInputPosition; 515 515 516 516 for (unsigned i = 0; i < alternative->m_terms.size(); ++i) { … … 521 521 case PatternTerm::TypeAssertionEOL: 522 522 case PatternTerm::TypeAssertionWordBoundary: 523 term.inputPosition = currentInputPosition ;523 term.inputPosition = currentInputPosition.unsafeGet(); 524 524 break; 525 525 526 526 case PatternTerm::TypeBackReference: 527 term.inputPosition = currentInputPosition ;527 term.inputPosition = currentInputPosition.unsafeGet(); 528 528 term.frameLocation = currentCallFrameSize; 529 529 currentCallFrameSize += YarrStackSpaceForBackTrackInfoBackReference; … … 535 535 536 536 case PatternTerm::TypePatternCharacter: 537 term.inputPosition = currentInputPosition ;537 term.inputPosition = currentInputPosition.unsafeGet(); 538 538 if (term.quantityType != QuantifierFixedCount) { 539 539 term.frameLocation = currentCallFrameSize; … … 545 545 546 546 case PatternTerm::TypeCharacterClass: 547 term.inputPosition = currentInputPosition ;547 term.inputPosition = currentInputPosition.unsafeGet(); 548 548 if (term.quantityType != QuantifierFixedCount) { 549 549 term.frameLocation = currentCallFrameSize; … … 560 560 if (term.quantityType != QuantifierFixedCount) 561 561 currentCallFrameSize += YarrStackSpaceForBackTrackInfoParenthesesOnce; 562 currentCallFrameSize = setupDisjunctionOffsets(term.parentheses.disjunction, currentCallFrameSize, currentInputPosition );562 currentCallFrameSize = setupDisjunctionOffsets(term.parentheses.disjunction, currentCallFrameSize, currentInputPosition.unsafeGet()); 563 563 // If quantity is fixed, then pre-check its minimum size. 564 564 if (term.quantityType == QuantifierFixedCount) 565 565 currentInputPosition += term.parentheses.disjunction->m_minimumSize; 566 term.inputPosition = currentInputPosition ;566 term.inputPosition = currentInputPosition.unsafeGet(); 567 567 } else if (term.parentheses.isTerminal) { 568 568 currentCallFrameSize += YarrStackSpaceForBackTrackInfoParenthesesTerminal; 569 currentCallFrameSize = setupDisjunctionOffsets(term.parentheses.disjunction, currentCallFrameSize, currentInputPosition );570 term.inputPosition = currentInputPosition ;569 currentCallFrameSize = setupDisjunctionOffsets(term.parentheses.disjunction, currentCallFrameSize, currentInputPosition.unsafeGet()); 570 term.inputPosition = currentInputPosition.unsafeGet(); 571 571 } else { 572 term.inputPosition = currentInputPosition ;573 setupDisjunctionOffsets(term.parentheses.disjunction, 0, currentInputPosition );572 term.inputPosition = currentInputPosition.unsafeGet(); 573 setupDisjunctionOffsets(term.parentheses.disjunction, 0, currentInputPosition.unsafeGet()); 574 574 currentCallFrameSize += YarrStackSpaceForBackTrackInfoParentheses; 575 575 } … … 579 579 580 580 case PatternTerm::TypeParentheticalAssertion: 581 term.inputPosition = currentInputPosition ;581 term.inputPosition = currentInputPosition.unsafeGet(); 582 582 term.frameLocation = currentCallFrameSize; 583 currentCallFrameSize = setupDisjunctionOffsets(term.parentheses.disjunction, currentCallFrameSize + YarrStackSpaceForBackTrackInfoParentheticalAssertion, currentInputPosition );583 currentCallFrameSize = setupDisjunctionOffsets(term.parentheses.disjunction, currentCallFrameSize + YarrStackSpaceForBackTrackInfoParentheticalAssertion, currentInputPosition.unsafeGet()); 584 584 break; 585 585 … … 591 591 } 592 592 593 alternative->m_minimumSize = currentInputPosition - initialInputPosition;593 alternative->m_minimumSize = (currentInputPosition - initialInputPosition).unsafeGet(); 594 594 return currentCallFrameSize; 595 595 }
Note:
See TracChangeset
for help on using the changeset viewer.