Changeset 41842 in webkit for trunk/JavaScriptCore/pcre
- Timestamp:
- Mar 19, 2009, 1:32:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/pcre/pcre_internal.h
r39554 r41842 86 86 patterns up to 64K long. */ 87 87 88 #define LINK_SIZE 288 #define LINK_SIZE 3 89 89 90 90 /* Define DEBUG to get debugging output on stdout. */ … … 125 125 } 126 126 127 static inline void put3ByteValue(unsigned char* opcodePtr, int value) 128 { 129 ASSERT(value >= 0 && value <= 0xFFFFFF); 130 opcodePtr[0] = value >> 16; 131 opcodePtr[1] = value >> 8; 132 opcodePtr[2] = value; 133 } 134 127 135 static inline int get2ByteValue(const unsigned char* opcodePtr) 128 136 { 129 137 return (opcodePtr[0] << 8) | opcodePtr[1]; 138 } 139 140 static inline int get3ByteValue(const unsigned char* opcodePtr) 141 { 142 return (opcodePtr[0] << 16) | (opcodePtr[1] << 8) | opcodePtr[2]; 130 143 } 131 144 … … 136 149 } 137 150 151 static inline void put3ByteValueAndAdvance(unsigned char*& opcodePtr, int value) 152 { 153 put3ByteValue(opcodePtr, value); 154 opcodePtr += 3; 155 } 156 138 157 static inline void putLinkValueAllowZero(unsigned char* opcodePtr, int value) 139 158 { 159 #if LINK_SIZE == 3 160 put3ByteValue(opcodePtr, value); 161 #elif LINK_SIZE == 2 140 162 put2ByteValue(opcodePtr, value); 163 #else 164 # error LINK_SIZE not supported. 165 #endif 141 166 } 142 167 143 168 static inline int getLinkValueAllowZero(const unsigned char* opcodePtr) 144 169 { 170 #if LINK_SIZE == 3 171 return get3ByteValue(opcodePtr); 172 #elif LINK_SIZE == 2 145 173 return get2ByteValue(opcodePtr); 146 } 147 148 #define MAX_PATTERN_SIZE (1 << 16) 174 #else 175 # error LINK_SIZE not supported. 176 #endif 177 } 178 179 #define MAX_PATTERN_SIZE 1024 * 1024 // Derived by empirical testing of compile time in PCRE and WREC. 180 COMPILE_ASSERT(MAX_PATTERN_SIZE < (1 << (8 * LINK_SIZE)), pcre_max_pattern_fits_in_bytecode); 149 181 150 182 static inline void putLinkValue(unsigned char* opcodePtr, int value)
Note:
See TracChangeset
for help on using the changeset viewer.