Changeset 259092 in webkit for trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp
- Timestamp:
- Mar 26, 2020, 4:27:57 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp
r259026 r259092 34 34 #include <wtf/DataLog.h> 35 35 #include <wtf/Optional.h> 36 #include <wtf/Stack Pointer.h>36 #include <wtf/StackCheck.h> 37 37 #include <wtf/Threading.h> 38 38 #include <wtf/Vector.h> … … 437 437 class YarrPatternConstructor { 438 438 public: 439 YarrPatternConstructor(YarrPattern& pattern , void* stackLimit)439 YarrPatternConstructor(YarrPattern& pattern) 440 440 : m_pattern(pattern) 441 441 , m_characterClassConstructor(pattern.ignoreCase(), pattern.unicode() ? CanonicalMode::Unicode : CanonicalMode::UCS2) 442 , m_stackLimit(stackLimit)443 442 { 444 443 auto body = makeUnique<PatternDisjunction>(); … … 1102 1101 1103 1102 private: 1104 bool isSafeToRecurse() const 1105 { 1106 if (!m_stackLimit) 1107 return true; 1108 int8_t* curr = reinterpret_cast<int8_t*>(currentStackPointer()); 1109 int8_t* limit = reinterpret_cast<int8_t*>(m_stackLimit); 1110 return curr >= limit; 1111 } 1103 inline bool isSafeToRecurse() { return m_stackCheck.isSafeToRecurse(); } 1112 1104 1113 1105 YarrPattern& m_pattern; 1114 1106 PatternAlternative* m_alternative; 1115 1107 CharacterClassConstructor m_characterClassConstructor; 1116 void* m_stackLimit;1108 StackCheck m_stackCheck; 1117 1109 ErrorCode m_error { ErrorCode::NoError }; 1118 1110 bool m_invertCharacterClass; … … 1120 1112 }; 1121 1113 1122 ErrorCode YarrPattern::compile(const String& patternString , void* stackLimit)1114 ErrorCode YarrPattern::compile(const String& patternString) 1123 1115 { 1124 YarrPatternConstructor constructor(*this , stackLimit);1116 YarrPatternConstructor constructor(*this); 1125 1117 1126 1118 { … … 1149 1141 } 1150 1142 1151 YarrPattern::YarrPattern(const String& pattern, OptionSet<Flags> flags, ErrorCode& error , void* stackLimit)1143 YarrPattern::YarrPattern(const String& pattern, OptionSet<Flags> flags, ErrorCode& error) 1152 1144 : m_containsBackreferences(false) 1153 1145 , m_containsBOL(false) … … 1158 1150 { 1159 1151 ASSERT(m_flags != Flags::DeletedValue); 1160 error = compile(pattern , stackLimit);1152 error = compile(pattern); 1161 1153 } 1162 1154
Note:
See TracChangeset
for help on using the changeset viewer.