Changeset 252239 in webkit for trunk/Source/JavaScriptCore/yarr/YarrInterpreter.cpp
- Timestamp:
- Nov 8, 2019, 8:58:49 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/yarr/YarrInterpreter.cpp
r248846 r252239 35 35 #include <wtf/CheckedArithmetic.h> 36 36 #include <wtf/DataLog.h> 37 #include <wtf/StackCheck.h> 37 38 #include <wtf/text/CString.h> 38 39 #include <wtf/text/WTFString.h> … … 1695 1696 std::unique_ptr<BytecodePattern> compile(BumpPointerAllocator* allocator, ConcurrentJSLock* lock, ErrorCode& errorCode) 1696 1697 { 1698 if (UNLIKELY(!isSafeToRecurse())) { 1699 errorCode = ErrorCode::TooManyDisjunctions; 1700 return nullptr; 1701 } 1702 1697 1703 regexBegin(m_pattern.m_numSubpatterns, m_pattern.m_body->m_callFrameSize, m_pattern.m_body->m_alternatives[0]->onceThrough()); 1698 1704 if (auto error = emitDisjunction(m_pattern.m_body, 0, 0)) { … … 2029 2035 Optional<ErrorCode> WARN_UNUSED_RETURN emitDisjunction(PatternDisjunction* disjunction, Checked<unsigned, RecordOverflow> inputCountAlreadyChecked, unsigned parenthesesInputCountAlreadyChecked) 2030 2036 { 2037 if (UNLIKELY(!isSafeToRecurse())) 2038 return ErrorCode::TooManyDisjunctions; 2039 2031 2040 for (unsigned alt = 0; alt < disjunction->m_alternatives.size(); ++alt) { 2032 2041 auto currentCountAlreadyChecked = inputCountAlreadyChecked; … … 2406 2415 2407 2416 private: 2417 inline bool isSafeToRecurse() { return m_stackCheck.isSafeToRecurse(); } 2418 2408 2419 YarrPattern& m_pattern; 2409 2420 std::unique_ptr<ByteDisjunction> m_bodyDisjunction; 2421 StackCheck m_stackCheck; 2410 2422 unsigned m_currentAlternativeIndex { 0 }; 2411 2423 Vector<ParenthesesStackEntry> m_parenthesesStack;
Note:
See TracChangeset
for help on using the changeset viewer.