Gentoo Archives: gentoo-commits

From: "Andreas Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/icu/files/, dev-libs/icu/
Date: Mon, 02 Nov 2015 21:51:56
Message-Id: 1446501094.236e3a215901857f964efa457fa6b3c1bf5c6c10.dilfridge@gentoo
1 commit: 236e3a215901857f964efa457fa6b3c1bf5c6c10
2 Author: Andreas K. Huettel (dilfridge) <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 2 21:51:34 2015 +0000
4 Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 2 21:51:34 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=236e3a21
7
8 dev-libs/icu: Remove old
9
10 Package-Manager: portage-2.2.23
11
12 dev-libs/icu/Manifest | 1 -
13 dev-libs/icu/files/icu-54.1-CVE-2014-9654.patch | 1105 -----------------------
14 dev-libs/icu/icu-54.1-r1.ebuild | 135 ---
15 3 files changed, 1241 deletions(-)
16
17 diff --git a/dev-libs/icu/Manifest b/dev-libs/icu/Manifest
18 index 2374fdc..f600c9f 100644
19 --- a/dev-libs/icu/Manifest
20 +++ b/dev-libs/icu/Manifest
21 @@ -1,2 +1 @@
22 -DIST icu4c-54_1-src.tgz 25485678 SHA256 d42bc9a8ca6a91c55eb0925c279f49e5b508d51ef26ac9850d9be55de5bb8ab3 SHA512 d54d4cd826e1aef62a574595a04f9fec0a42c4445ed0a166a6bb5c5f3c9f692bf3273756f350233f50b2a1ad32c437dedfeeac96d6dc814d27bfd9159b7a651c WHIRLPOOL 1ae01eb26824ca591ff76ea040f703023f24975ad4177d49b1dd60f7e7f96f60884745d6c6e5e2bdf17fc8e104e97ed814f6c0ca051d1807814e324eb24e94dd
23 DIST icu4c-55_1-src.tgz 25600847 SHA256 e16b22cbefdd354bec114541f7849a12f8fc2015320ca5282ee4fd787571457b SHA512 21a3eb2c3678cd27b659eed073f8f1bd99c9751291d077820e9a370fd90b7d9b3bf414cc03dec4acb7fa61087e02d04f9f40e91a32c5180c718e2102fbd0cd35 WHIRLPOOL 8c5221c82ee2c8a02beafd0fdf91e0038e49912cc8b05fb7437dd4d0a0204b97ea62c45c2dd9dde0f658620b772d706e795821865c567d2e1eb91f8b83a12c4a
24
25 diff --git a/dev-libs/icu/files/icu-54.1-CVE-2014-9654.patch b/dev-libs/icu/files/icu-54.1-CVE-2014-9654.patch
26 deleted file mode 100644
27 index db86c92..0000000
28 --- a/dev-libs/icu/files/icu-54.1-CVE-2014-9654.patch
29 +++ /dev/null
30 @@ -1,1105 +0,0 @@
31 -Index: /icu/trunk/source/common/unicode/utypes.h
32 -===================================================================
33 ---- /icu/trunk/source/common/unicode/utypes.h (revision 36800)
34 -+++ /icu/trunk/source/common/unicode/utypes.h (revision 36801)
35 -@@ -648,4 +648,5 @@
36 - U_REGEX_TIME_OUT, /**< Maximum allowed match time exceeded */
37 - U_REGEX_STOPPED_BY_CALLER, /**< Matching operation aborted by user callback fn. */
38 -+ U_REGEX_PATTERN_TOO_BIG, /**< Pattern exceeds limits on size or complexity. @draft ICU 55 */
39 - U_REGEX_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for regexp errors */
40 -
41 -Index: /icu/trunk/source/common/utypes.c
42 -===================================================================
43 ---- /icu/trunk/source/common/utypes.c (revision 36800)
44 -+++ /icu/trunk/source/common/utypes.c (revision 36801)
45 -@@ -2,5 +2,5 @@
46 - ******************************************************************************
47 - *
48 --* Copyright (C) 1997-2011, International Business Machines
49 -+* Copyright (C) 1997-2014, International Business Machines
50 - * Corporation and others. All Rights Reserved.
51 - *
52 -@@ -166,5 +166,6 @@
53 - "U_REGEX_STACK_OVERFLOW",
54 - "U_REGEX_TIME_OUT",
55 -- "U_REGEX_STOPPED_BY_CALLER"
56 -+ "U_REGEX_STOPPED_BY_CALLER",
57 -+ "U_REGEX_PATTERN_TOO_BIG"
58 - };
59 -
60 -Index: /icu/trunk/source/i18n/regexcmp.cpp
61 -===================================================================
62 ---- /icu/trunk/source/i18n/regexcmp.cpp (revision 36800)
63 -+++ /icu/trunk/source/i18n/regexcmp.cpp (revision 36801)
64 -@@ -305,5 +305,5 @@
65 - // the position in the compiled pattern.
66 - //
67 -- fRXPat->fFrameSize+=RESTACKFRAME_HDRCOUNT;
68 -+ allocateStackData(RESTACKFRAME_HDRCOUNT);
69 -
70 - //
71 -@@ -371,7 +371,7 @@
72 - //4 NOP Resreved, will be replaced by a save if there are
73 - // OR | operators at the top level
74 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_STATE_SAVE, 2), *fStatus);
75 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_JMP, 3), *fStatus);
76 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_FAIL, 0), *fStatus);
77 -+ appendOp(URX_STATE_SAVE, 2);
78 -+ appendOp(URX_JMP, 3);
79 -+ appendOp(URX_FAIL, 0);
80 -
81 - // Standard open nonCapture paren action emits the two NOPs and
82 -@@ -396,5 +396,5 @@
83 -
84 - // add the END operation to the compiled pattern.
85 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_END, 0), *fStatus);
86 -+ appendOp(URX_END, 0);
87 -
88 - // Terminate the pattern compilation state machine.
89 -@@ -418,5 +418,5 @@
90 - int32_t op = (int32_t)fRXPat->fCompiledPat->elementAti(savePosition);
91 - U_ASSERT(URX_TYPE(op) == URX_NOP); // original contents of reserved location
92 -- op = URX_BUILD(URX_STATE_SAVE, fRXPat->fCompiledPat->size()+1);
93 -+ op = buildOp(URX_STATE_SAVE, fRXPat->fCompiledPat->size()+1);
94 - fRXPat->fCompiledPat->setElementAt(op, savePosition);
95 -
96 -@@ -424,6 +424,5 @@
97 - // the JMP will eventually be the location following the ')' for the
98 - // group. This will be patched in later, when the ')' is encountered.
99 -- op = URX_BUILD(URX_JMP, 0);
100 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
101 -+ appendOp(URX_JMP, 0);
102 -
103 - // Push the position of the newly added JMP op onto the parentheses stack.
104 -@@ -434,5 +433,5 @@
105 - // for a SAVE in the event that there is yet another '|' following
106 - // this one.
107 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus);
108 -+ appendOp(URX_NOP, 0);
109 - fParenStack.push(fRXPat->fCompiledPat->size()-1, *fStatus);
110 - }
111 -@@ -460,10 +459,8 @@
112 - {
113 - fixLiterals();
114 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus);
115 -- int32_t varsLoc = fRXPat->fFrameSize; // Reserve three slots in match stack frame.
116 -- fRXPat->fFrameSize += 3;
117 -- int32_t cop = URX_BUILD(URX_START_CAPTURE, varsLoc);
118 -- fRXPat->fCompiledPat->addElement(cop, *fStatus);
119 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus);
120 -+ appendOp(URX_NOP, 0);
121 -+ int32_t varsLoc = allocateStackData(3); // Reserve three slots in match stack frame.
122 -+ appendOp(URX_START_CAPTURE, varsLoc);
123 -+ appendOp(URX_NOP, 0);
124 -
125 - // On the Parentheses stack, start a new frame and add the postions
126 -@@ -490,6 +487,6 @@
127 - {
128 - fixLiterals();
129 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus);
130 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus);
131 -+ appendOp(URX_NOP, 0);
132 -+ appendOp(URX_NOP, 0);
133 -
134 - // On the Parentheses stack, start a new frame and add the postions
135 -@@ -513,10 +510,8 @@
136 - {
137 - fixLiterals();
138 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus);
139 -- int32_t varLoc = fRXPat->fDataSize; // Reserve a data location for saving the
140 -- fRXPat->fDataSize += 1; // state stack ptr.
141 -- int32_t stoOp = URX_BUILD(URX_STO_SP, varLoc);
142 -- fRXPat->fCompiledPat->addElement(stoOp, *fStatus);
143 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus);
144 -+ appendOp(URX_NOP, 0);
145 -+ int32_t varLoc = allocateData(1); // Reserve a data location for saving the state stack ptr.
146 -+ appendOp(URX_STO_SP, varLoc);
147 -+ appendOp(URX_NOP, 0);
148 -
149 - // On the Parentheses stack, start a new frame and add the postions
150 -@@ -561,24 +556,12 @@
151 - {
152 - fixLiterals();
153 -- int32_t dataLoc = fRXPat->fDataSize;
154 -- fRXPat->fDataSize += 2;
155 -- int32_t op = URX_BUILD(URX_LA_START, dataLoc);
156 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
157 --
158 -- op = URX_BUILD(URX_STATE_SAVE, fRXPat->fCompiledPat->size()+ 2);
159 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
160 --
161 -- op = URX_BUILD(URX_JMP, fRXPat->fCompiledPat->size()+ 3);
162 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
163 --
164 -- op = URX_BUILD(URX_LA_END, dataLoc);
165 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
166 --
167 -- op = URX_BUILD(URX_BACKTRACK, 0);
168 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
169 --
170 -- op = URX_BUILD(URX_NOP, 0);
171 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
172 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
173 -+ int32_t dataLoc = allocateData(2);
174 -+ appendOp(URX_LA_START, dataLoc);
175 -+ appendOp(URX_STATE_SAVE, fRXPat->fCompiledPat->size()+ 2);
176 -+ appendOp(URX_JMP, fRXPat->fCompiledPat->size()+ 3);
177 -+ appendOp(URX_LA_END, dataLoc);
178 -+ appendOp(URX_BACKTRACK, 0);
179 -+ appendOp(URX_NOP, 0);
180 -+ appendOp(URX_NOP, 0);
181 -
182 - // On the Parentheses stack, start a new frame and add the postions
183 -@@ -605,14 +588,8 @@
184 - {
185 - fixLiterals();
186 -- int32_t dataLoc = fRXPat->fDataSize;
187 -- fRXPat->fDataSize += 2;
188 -- int32_t op = URX_BUILD(URX_LA_START, dataLoc);
189 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
190 --
191 -- op = URX_BUILD(URX_STATE_SAVE, 0); // dest address will be patched later.
192 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
193 --
194 -- op = URX_BUILD(URX_NOP, 0);
195 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
196 -+ int32_t dataLoc = allocateData(2);
197 -+ appendOp(URX_LA_START, dataLoc);
198 -+ appendOp(URX_STATE_SAVE, 0); // dest address will be patched later.
199 -+ appendOp(URX_NOP, 0);
200 -
201 - // On the Parentheses stack, start a new frame and add the postions
202 -@@ -652,21 +629,17 @@
203 -
204 - // Allocate data space
205 -- int32_t dataLoc = fRXPat->fDataSize;
206 -- fRXPat->fDataSize += 4;
207 -+ int32_t dataLoc = allocateData(4);
208 -
209 - // Emit URX_LB_START
210 -- int32_t op = URX_BUILD(URX_LB_START, dataLoc);
211 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
212 -+ appendOp(URX_LB_START, dataLoc);
213 -
214 - // Emit URX_LB_CONT
215 -- op = URX_BUILD(URX_LB_CONT, dataLoc);
216 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
217 -- fRXPat->fCompiledPat->addElement(0, *fStatus); // MinMatchLength. To be filled later.
218 -- fRXPat->fCompiledPat->addElement(0, *fStatus); // MaxMatchLength. To be filled later.
219 --
220 -- // Emit the NOP
221 -- op = URX_BUILD(URX_NOP, 0);
222 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
223 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
224 -+ appendOp(URX_LB_CONT, dataLoc);
225 -+ appendOp(URX_RESERVED_OP, 0); // MinMatchLength. To be filled later.
226 -+ appendOp(URX_RESERVED_OP, 0); // MaxMatchLength. To be filled later.
227 -+
228 -+ // Emit the NOPs
229 -+ appendOp(URX_NOP, 0);
230 -+ appendOp(URX_NOP, 0);
231 -
232 - // On the Parentheses stack, start a new frame and add the postions
233 -@@ -708,22 +681,18 @@
234 -
235 - // Allocate data space
236 -- int32_t dataLoc = fRXPat->fDataSize;
237 -- fRXPat->fDataSize += 4;
238 -+ int32_t dataLoc = allocateData(4);
239 -
240 - // Emit URX_LB_START
241 -- int32_t op = URX_BUILD(URX_LB_START, dataLoc);
242 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
243 -+ appendOp(URX_LB_START, dataLoc);
244 -
245 - // Emit URX_LBN_CONT
246 -- op = URX_BUILD(URX_LBN_CONT, dataLoc);
247 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
248 -- fRXPat->fCompiledPat->addElement(0, *fStatus); // MinMatchLength. To be filled later.
249 -- fRXPat->fCompiledPat->addElement(0, *fStatus); // MaxMatchLength. To be filled later.
250 -- fRXPat->fCompiledPat->addElement(0, *fStatus); // Continue Loc. To be filled later.
251 --
252 -- // Emit the NOP
253 -- op = URX_BUILD(URX_NOP, 0);
254 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
255 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
256 -+ appendOp(URX_LBN_CONT, dataLoc);
257 -+ appendOp(URX_RESERVED_OP, 0); // MinMatchLength. To be filled later.
258 -+ appendOp(URX_RESERVED_OP, 0); // MaxMatchLength. To be filled later.
259 -+ appendOp(URX_RESERVED_OP, 0); // Continue Loc. To be filled later.
260 -+
261 -+ // Emit the NOPs
262 -+ appendOp(URX_NOP, 0);
263 -+ appendOp(URX_NOP, 0);
264 -
265 - // On the Parentheses stack, start a new frame and add the postions
266 -@@ -795,10 +764,7 @@
267 - if (URX_TYPE(repeatedOp) == URX_SETREF) {
268 - // Emit optimized code for [char set]+
269 -- int32_t loopOpI = URX_BUILD(URX_LOOP_SR_I, URX_VAL(repeatedOp));
270 -- fRXPat->fCompiledPat->addElement(loopOpI, *fStatus);
271 -- frameLoc = fRXPat->fFrameSize;
272 -- fRXPat->fFrameSize++;
273 -- int32_t loopOpC = URX_BUILD(URX_LOOP_C, frameLoc);
274 -- fRXPat->fCompiledPat->addElement(loopOpC, *fStatus);
275 -+ appendOp(URX_LOOP_SR_I, URX_VAL(repeatedOp));
276 -+ frameLoc = allocateStackData(1);
277 -+ appendOp(URX_LOOP_C, frameLoc);
278 - break;
279 - }
280 -@@ -808,5 +774,5 @@
281 - URX_TYPE(repeatedOp) == URX_DOTANY_UNIX) {
282 - // Emit Optimized code for .+ operations.
283 -- int32_t loopOpI = URX_BUILD(URX_LOOP_DOT_I, 0);
284 -+ int32_t loopOpI = buildOp(URX_LOOP_DOT_I, 0);
285 - if (URX_TYPE(repeatedOp) == URX_DOTANY_ALL) {
286 - // URX_LOOP_DOT_I operand is a flag indicating ". matches any" mode.
287 -@@ -816,9 +782,7 @@
288 - loopOpI |= 2;
289 - }
290 -- fRXPat->fCompiledPat->addElement(loopOpI, *fStatus);
291 -- frameLoc = fRXPat->fFrameSize;
292 -- fRXPat->fFrameSize++;
293 -- int32_t loopOpC = URX_BUILD(URX_LOOP_C, frameLoc);
294 -- fRXPat->fCompiledPat->addElement(loopOpC, *fStatus);
295 -+ appendOp(loopOpI);
296 -+ frameLoc = allocateStackData(1);
297 -+ appendOp(URX_LOOP_C, frameLoc);
298 - break;
299 - }
300 -@@ -834,16 +798,13 @@
301 - // Emit the code sequence that can handle it.
302 - insertOp(topLoc);
303 -- frameLoc = fRXPat->fFrameSize;
304 -- fRXPat->fFrameSize++;
305 --
306 -- int32_t op = URX_BUILD(URX_STO_INP_LOC, frameLoc);
307 -+ frameLoc = allocateStackData(1);
308 -+
309 -+ int32_t op = buildOp(URX_STO_INP_LOC, frameLoc);
310 - fRXPat->fCompiledPat->setElementAt(op, topLoc);
311 -
312 -- op = URX_BUILD(URX_JMP_SAV_X, topLoc+1);
313 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
314 -+ appendOp(URX_JMP_SAV_X, topLoc+1);
315 - } else {
316 - // Simpler code when the repeated body must match something non-empty
317 -- int32_t jmpOp = URX_BUILD(URX_JMP_SAV, topLoc);
318 -- fRXPat->fCompiledPat->addElement(jmpOp, *fStatus);
319 -+ appendOp(URX_JMP_SAV, topLoc);
320 - }
321 - }
322 -@@ -857,6 +818,5 @@
323 - {
324 - int32_t topLoc = blockTopLoc(FALSE);
325 -- int32_t saveStateOp = URX_BUILD(URX_STATE_SAVE, topLoc);
326 -- fRXPat->fCompiledPat->addElement(saveStateOp, *fStatus);
327 -+ appendOp(URX_STATE_SAVE, topLoc);
328 - }
329 - break;
330 -@@ -872,5 +832,5 @@
331 - {
332 - int32_t saveStateLoc = blockTopLoc(TRUE);
333 -- int32_t saveStateOp = URX_BUILD(URX_STATE_SAVE, fRXPat->fCompiledPat->size());
334 -+ int32_t saveStateOp = buildOp(URX_STATE_SAVE, fRXPat->fCompiledPat->size());
335 - fRXPat->fCompiledPat->setElementAt(saveStateOp, saveStateLoc);
336 - }
337 -@@ -891,12 +851,10 @@
338 - int32_t jmp2_loc = fRXPat->fCompiledPat->size();
339 -
340 -- int32_t jmp1_op = URX_BUILD(URX_JMP, jmp2_loc+1);
341 -+ int32_t jmp1_op = buildOp(URX_JMP, jmp2_loc+1);
342 - fRXPat->fCompiledPat->setElementAt(jmp1_op, jmp1_loc);
343 -
344 -- int32_t jmp2_op = URX_BUILD(URX_JMP, jmp2_loc+2);
345 -- fRXPat->fCompiledPat->addElement(jmp2_op, *fStatus);
346 --
347 -- int32_t save_op = URX_BUILD(URX_STATE_SAVE, jmp1_loc+1);
348 -- fRXPat->fCompiledPat->addElement(save_op, *fStatus);
349 -+ appendOp(URX_JMP, jmp2_loc+2);
350 -+
351 -+ appendOp(URX_STATE_SAVE, jmp1_loc+1);
352 - }
353 - break;
354 -@@ -938,10 +896,8 @@
355 - if (URX_TYPE(repeatedOp) == URX_SETREF) {
356 - // Emit optimized code for a [char set]*
357 -- int32_t loopOpI = URX_BUILD(URX_LOOP_SR_I, URX_VAL(repeatedOp));
358 -+ int32_t loopOpI = buildOp(URX_LOOP_SR_I, URX_VAL(repeatedOp));
359 - fRXPat->fCompiledPat->setElementAt(loopOpI, topLoc);
360 -- dataLoc = fRXPat->fFrameSize;
361 -- fRXPat->fFrameSize++;
362 -- int32_t loopOpC = URX_BUILD(URX_LOOP_C, dataLoc);
363 -- fRXPat->fCompiledPat->addElement(loopOpC, *fStatus);
364 -+ dataLoc = allocateStackData(1);
365 -+ appendOp(URX_LOOP_C, dataLoc);
366 - break;
367 - }
368 -@@ -951,5 +907,5 @@
369 - URX_TYPE(repeatedOp) == URX_DOTANY_UNIX) {
370 - // Emit Optimized code for .* operations.
371 -- int32_t loopOpI = URX_BUILD(URX_LOOP_DOT_I, 0);
372 -+ int32_t loopOpI = buildOp(URX_LOOP_DOT_I, 0);
373 - if (URX_TYPE(repeatedOp) == URX_DOTANY_ALL) {
374 - // URX_LOOP_DOT_I operand is a flag indicating . matches any mode.
375 -@@ -960,8 +916,6 @@
376 - }
377 - fRXPat->fCompiledPat->setElementAt(loopOpI, topLoc);
378 -- dataLoc = fRXPat->fFrameSize;
379 -- fRXPat->fFrameSize++;
380 -- int32_t loopOpC = URX_BUILD(URX_LOOP_C, dataLoc);
381 -- fRXPat->fCompiledPat->addElement(loopOpC, *fStatus);
382 -+ dataLoc = allocateStackData(1);
383 -+ appendOp(URX_LOOP_C, dataLoc);
384 - break;
385 - }
386 -@@ -972,5 +926,5 @@
387 -
388 - int32_t saveStateLoc = blockTopLoc(TRUE);
389 -- int32_t jmpOp = URX_BUILD(URX_JMP_SAV, saveStateLoc+1);
390 -+ int32_t jmpOp = buildOp(URX_JMP_SAV, saveStateLoc+1);
391 -
392 - // Check for minimum match length of zero, which requires
393 -@@ -978,10 +932,9 @@
394 - if (minMatchLength(saveStateLoc, fRXPat->fCompiledPat->size()-1) == 0) {
395 - insertOp(saveStateLoc);
396 -- dataLoc = fRXPat->fFrameSize;
397 -- fRXPat->fFrameSize++;
398 --
399 -- int32_t op = URX_BUILD(URX_STO_INP_LOC, dataLoc);
400 -+ dataLoc = allocateStackData(1);
401 -+
402 -+ int32_t op = buildOp(URX_STO_INP_LOC, dataLoc);
403 - fRXPat->fCompiledPat->setElementAt(op, saveStateLoc+1);
404 -- jmpOp = URX_BUILD(URX_JMP_SAV_X, saveStateLoc+2);
405 -+ jmpOp = buildOp(URX_JMP_SAV_X, saveStateLoc+2);
406 - }
407 -
408 -@@ -990,10 +943,10 @@
409 - int32_t continueLoc = fRXPat->fCompiledPat->size()+1;
410 -
411 -- // Put together the save state op store it into the compiled code.
412 -- int32_t saveStateOp = URX_BUILD(URX_STATE_SAVE, continueLoc);
413 -+ // Put together the save state op and store it into the compiled code.
414 -+ int32_t saveStateOp = buildOp(URX_STATE_SAVE, continueLoc);
415 - fRXPat->fCompiledPat->setElementAt(saveStateOp, saveStateLoc);
416 -
417 - // Append the URX_JMP_SAV or URX_JMPX operation to the compiled pattern.
418 -- fRXPat->fCompiledPat->addElement(jmpOp, *fStatus);
419 -+ appendOp(jmpOp);
420 - }
421 - break;
422 -@@ -1009,8 +962,7 @@
423 - int32_t jmpLoc = blockTopLoc(TRUE); // loc 1.
424 - int32_t saveLoc = fRXPat->fCompiledPat->size(); // loc 3.
425 -- int32_t jmpOp = URX_BUILD(URX_JMP, saveLoc);
426 -- int32_t stateSaveOp = URX_BUILD(URX_STATE_SAVE, jmpLoc+1);
427 -+ int32_t jmpOp = buildOp(URX_JMP, saveLoc);
428 - fRXPat->fCompiledPat->setElementAt(jmpOp, jmpLoc);
429 -- fRXPat->fCompiledPat->addElement(stateSaveOp, *fStatus);
430 -+ appendOp(URX_STATE_SAVE, jmpLoc+1);
431 - }
432 - break;
433 -@@ -1085,7 +1037,7 @@
434 - // First the STO_SP before the start of the loop
435 - insertOp(topLoc);
436 -- int32_t varLoc = fRXPat->fDataSize; // Reserve a data location for saving the
437 -- fRXPat->fDataSize += 1; // state stack ptr.
438 -- int32_t op = URX_BUILD(URX_STO_SP, varLoc);
439 -+
440 -+ int32_t varLoc = allocateData(1); // Reserve a data location for saving the
441 -+ int32_t op = buildOp(URX_STO_SP, varLoc);
442 - fRXPat->fCompiledPat->setElementAt(op, topLoc);
443 -
444 -@@ -1096,6 +1048,5 @@
445 -
446 - // Then the LD_SP after the end of the loop
447 -- op = URX_BUILD(URX_LD_SP, varLoc);
448 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
449 -+ appendOp(URX_LD_SP, varLoc);
450 - }
451 -
452 -@@ -1133,13 +1084,11 @@
453 - {
454 - fixLiterals(FALSE);
455 -- int32_t op;
456 - if (fModeFlags & UREGEX_DOTALL) {
457 -- op = URX_BUILD(URX_DOTANY_ALL, 0);
458 -+ appendOp(URX_DOTANY_ALL, 0);
459 - } else if (fModeFlags & UREGEX_UNIX_LINES) {
460 -- op = URX_BUILD(URX_DOTANY_UNIX, 0);
461 -+ appendOp(URX_DOTANY_UNIX, 0);
462 - } else {
463 -- op = URX_BUILD(URX_DOTANY, 0);
464 -- }
465 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
466 -+ appendOp(URX_DOTANY, 0);
467 -+ }
468 - }
469 - break;
470 -@@ -1148,15 +1097,13 @@
471 - {
472 - fixLiterals(FALSE);
473 -- int32_t op = 0;
474 - if ( (fModeFlags & UREGEX_MULTILINE) == 0 && (fModeFlags & UREGEX_UNIX_LINES) == 0) {
475 -- op = URX_CARET;
476 -+ appendOp(URX_CARET, 0);
477 - } else if ((fModeFlags & UREGEX_MULTILINE) != 0 && (fModeFlags & UREGEX_UNIX_LINES) == 0) {
478 -- op = URX_CARET_M;
479 -+ appendOp(URX_CARET_M, 0);
480 - } else if ((fModeFlags & UREGEX_MULTILINE) == 0 && (fModeFlags & UREGEX_UNIX_LINES) != 0) {
481 -- op = URX_CARET; // Only testing true start of input.
482 -+ appendOp(URX_CARET, 0); // Only testing true start of input.
483 - } else if ((fModeFlags & UREGEX_MULTILINE) != 0 && (fModeFlags & UREGEX_UNIX_LINES) != 0) {
484 -- op = URX_CARET_M_UNIX;
485 -- }
486 -- fRXPat->fCompiledPat->addElement(URX_BUILD(op, 0), *fStatus);
487 -+ appendOp(URX_CARET_M_UNIX, 0);
488 -+ }
489 - }
490 - break;
491 -@@ -1165,15 +1112,13 @@
492 - {
493 - fixLiterals(FALSE);
494 -- int32_t op = 0;
495 - if ( (fModeFlags & UREGEX_MULTILINE) == 0 && (fModeFlags & UREGEX_UNIX_LINES) == 0) {
496 -- op = URX_DOLLAR;
497 -+ appendOp(URX_DOLLAR, 0);
498 - } else if ((fModeFlags & UREGEX_MULTILINE) != 0 && (fModeFlags & UREGEX_UNIX_LINES) == 0) {
499 -- op = URX_DOLLAR_M;
500 -+ appendOp(URX_DOLLAR_M, 0);
501 - } else if ((fModeFlags & UREGEX_MULTILINE) == 0 && (fModeFlags & UREGEX_UNIX_LINES) != 0) {
502 -- op = URX_DOLLAR_D;
503 -+ appendOp(URX_DOLLAR_D, 0);
504 - } else if ((fModeFlags & UREGEX_MULTILINE) != 0 && (fModeFlags & UREGEX_UNIX_LINES) != 0) {
505 -- op = URX_DOLLAR_MD;
506 -- }
507 -- fRXPat->fCompiledPat->addElement(URX_BUILD(op, 0), *fStatus);
508 -+ appendOp(URX_DOLLAR_MD, 0);
509 -+ }
510 - }
511 - break;
512 -@@ -1181,5 +1126,5 @@
513 - case doBackslashA:
514 - fixLiterals(FALSE);
515 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_CARET, 0), *fStatus);
516 -+ appendOp(URX_CARET, 0);
517 - break;
518 -
519 -@@ -1193,5 +1138,5 @@
520 - fixLiterals(FALSE);
521 - int32_t op = (fModeFlags & UREGEX_UWORD)? URX_BACKSLASH_BU : URX_BACKSLASH_B;
522 -- fRXPat->fCompiledPat->addElement(URX_BUILD(op, 1), *fStatus);
523 -+ appendOp(op, 1);
524 - }
525 - break;
526 -@@ -1206,5 +1151,5 @@
527 - fixLiterals(FALSE);
528 - int32_t op = (fModeFlags & UREGEX_UWORD)? URX_BACKSLASH_BU : URX_BACKSLASH_B;
529 -- fRXPat->fCompiledPat->addElement(URX_BUILD(op, 0), *fStatus);
530 -+ appendOp(op, 0);
531 - }
532 - break;
533 -@@ -1212,44 +1157,40 @@
534 - case doBackslashD:
535 - fixLiterals(FALSE);
536 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_BACKSLASH_D, 1), *fStatus);
537 -+ appendOp(URX_BACKSLASH_D, 1);
538 - break;
539 -
540 - case doBackslashd:
541 - fixLiterals(FALSE);
542 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_BACKSLASH_D, 0), *fStatus);
543 -+ appendOp(URX_BACKSLASH_D, 0);
544 - break;
545 -
546 - case doBackslashG:
547 - fixLiterals(FALSE);
548 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_BACKSLASH_G, 0), *fStatus);
549 -+ appendOp(URX_BACKSLASH_G, 0);
550 - break;
551 -
552 - case doBackslashS:
553 - fixLiterals(FALSE);
554 -- fRXPat->fCompiledPat->addElement(
555 -- URX_BUILD(URX_STAT_SETREF_N, URX_ISSPACE_SET), *fStatus);
556 -+ appendOp(URX_STAT_SETREF_N, URX_ISSPACE_SET);
557 - break;
558 -
559 - case doBackslashs:
560 - fixLiterals(FALSE);
561 -- fRXPat->fCompiledPat->addElement(
562 -- URX_BUILD(URX_STATIC_SETREF, URX_ISSPACE_SET), *fStatus);
563 -+ appendOp(URX_STATIC_SETREF, URX_ISSPACE_SET);
564 - break;
565 -
566 - case doBackslashW:
567 - fixLiterals(FALSE);
568 -- fRXPat->fCompiledPat->addElement(
569 -- URX_BUILD(URX_STAT_SETREF_N, URX_ISWORD_SET), *fStatus);
570 -+ appendOp(URX_STAT_SETREF_N, URX_ISWORD_SET);
571 - break;
572 -
573 - case doBackslashw:
574 - fixLiterals(FALSE);
575 -- fRXPat->fCompiledPat->addElement(
576 -- URX_BUILD(URX_STATIC_SETREF, URX_ISWORD_SET), *fStatus);
577 -+ appendOp(URX_STATIC_SETREF, URX_ISWORD_SET);
578 - break;
579 -
580 - case doBackslashX:
581 - fixLiterals(FALSE);
582 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_BACKSLASH_X, 0), *fStatus);
583 -+ appendOp(URX_BACKSLASH_X, 0);
584 - break;
585 -
586 -@@ -1257,10 +1198,10 @@
587 - case doBackslashZ:
588 - fixLiterals(FALSE);
589 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_DOLLAR, 0), *fStatus);
590 -+ appendOp(URX_DOLLAR, 0);
591 - break;
592 -
593 - case doBackslashz:
594 - fixLiterals(FALSE);
595 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_BACKSLASH_Z, 0), *fStatus);
596 -+ appendOp(URX_BACKSLASH_Z, 0);
597 - break;
598 -
599 -@@ -1322,11 +1263,9 @@
600 - // and shouldn't enter this code path at all.
601 - fixLiterals(FALSE);
602 -- int32_t op;
603 - if (fModeFlags & UREGEX_CASE_INSENSITIVE) {
604 -- op = URX_BUILD(URX_BACKREF_I, groupNum);
605 -+ appendOp(URX_BACKREF_I, groupNum);
606 - } else {
607 -- op = URX_BUILD(URX_BACKREF, groupNum);
608 -- }
609 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
610 -+ appendOp(URX_BACKREF, groupNum);
611 -+ }
612 - }
613 - break;
614 -@@ -1349,20 +1288,16 @@
615 - // Emit the STO_SP
616 - int32_t topLoc = blockTopLoc(TRUE);
617 -- int32_t stoLoc = fRXPat->fDataSize;
618 -- fRXPat->fDataSize++; // Reserve the data location for storing save stack ptr.
619 -- int32_t op = URX_BUILD(URX_STO_SP, stoLoc);
620 -+ int32_t stoLoc = allocateData(1); // Reserve the data location for storing save stack ptr.
621 -+ int32_t op = buildOp(URX_STO_SP, stoLoc);
622 - fRXPat->fCompiledPat->setElementAt(op, topLoc);
623 -
624 - // Emit the STATE_SAVE
625 -- op = URX_BUILD(URX_STATE_SAVE, fRXPat->fCompiledPat->size()+2);
626 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
627 -+ appendOp(URX_STATE_SAVE, fRXPat->fCompiledPat->size()+2);
628 -
629 - // Emit the JMP
630 -- op = URX_BUILD(URX_JMP, topLoc+1);
631 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
632 -+ appendOp(URX_JMP, topLoc+1);
633 -
634 - // Emit the LD_SP
635 -- op = URX_BUILD(URX_LD_SP, stoLoc);
636 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
637 -+ appendOp(URX_LD_SP, stoLoc);
638 - }
639 - break;
640 -@@ -1384,21 +1319,18 @@
641 -
642 - // emit STO_SP loc
643 -- int32_t stoLoc = fRXPat->fDataSize;
644 -- fRXPat->fDataSize++; // Reserve the data location for storing save stack ptr.
645 -- int32_t op = URX_BUILD(URX_STO_SP, stoLoc);
646 -+ int32_t stoLoc = allocateData(1); // Reserve the data location for storing save stack ptr.
647 -+ int32_t op = buildOp(URX_STO_SP, stoLoc);
648 - fRXPat->fCompiledPat->setElementAt(op, topLoc);
649 -
650 - // Emit the SAVE_STATE 5
651 - int32_t L7 = fRXPat->fCompiledPat->size()+1;
652 -- op = URX_BUILD(URX_STATE_SAVE, L7);
653 -+ op = buildOp(URX_STATE_SAVE, L7);
654 - fRXPat->fCompiledPat->setElementAt(op, topLoc+1);
655 -
656 - // Append the JMP operation.
657 -- op = URX_BUILD(URX_JMP, topLoc+1);
658 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
659 -+ appendOp(URX_JMP, topLoc+1);
660 -
661 - // Emit the LD_SP loc
662 -- op = URX_BUILD(URX_LD_SP, stoLoc);
663 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
664 -+ appendOp(URX_LD_SP, stoLoc);
665 - }
666 - break;
667 -@@ -1419,17 +1351,15 @@
668 -
669 - // Emit the STO_SP
670 -- int32_t stoLoc = fRXPat->fDataSize;
671 -- fRXPat->fDataSize++; // Reserve the data location for storing save stack ptr.
672 -- int32_t op = URX_BUILD(URX_STO_SP, stoLoc);
673 -+ int32_t stoLoc = allocateData(1); // Reserve the data location for storing save stack ptr.
674 -+ int32_t op = buildOp(URX_STO_SP, stoLoc);
675 - fRXPat->fCompiledPat->setElementAt(op, topLoc);
676 -
677 - // Emit the SAVE_STATE
678 - int32_t continueLoc = fRXPat->fCompiledPat->size()+1;
679 -- op = URX_BUILD(URX_STATE_SAVE, continueLoc);
680 -+ op = buildOp(URX_STATE_SAVE, continueLoc);
681 - fRXPat->fCompiledPat->setElementAt(op, topLoc+1);
682 -
683 - // Emit the LD_SP
684 -- op = URX_BUILD(URX_LD_SP, stoLoc);
685 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
686 -+ appendOp(URX_LD_SP, stoLoc);
687 - }
688 - break;
689 -@@ -1488,6 +1418,6 @@
690 - {
691 - fixLiterals(FALSE);
692 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus);
693 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus);
694 -+ appendOp(URX_NOP, 0);
695 -+ appendOp(URX_NOP, 0);
696 -
697 - // On the Parentheses stack, start a new frame and add the postions
698 -@@ -1826,5 +1756,4 @@
699 - //------------------------------------------------------------------------------
700 - void RegexCompile::fixLiterals(UBool split) {
701 -- int32_t op = 0; // An op from/for the compiled pattern.
702 -
703 - // If no literal characters have been scanned but not yet had code generated
704 -@@ -1865,21 +1794,21 @@
705 - if ((fModeFlags & UREGEX_CASE_INSENSITIVE) &&
706 - u_hasBinaryProperty(lastCodePoint, UCHAR_CASE_SENSITIVE)) {
707 -- op = URX_BUILD(URX_ONECHAR_I, lastCodePoint);
708 -+ appendOp(URX_ONECHAR_I, lastCodePoint);
709 - } else {
710 -- op = URX_BUILD(URX_ONECHAR, lastCodePoint);
711 -- }
712 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
713 -+ appendOp(URX_ONECHAR, lastCodePoint);
714 -+ }
715 - } else {
716 - // Two or more chars, emit a URX_STRING to match them.
717 -+ if (fLiteralChars.length() > 0x00ffffff || fRXPat->fLiteralText.length() > 0x00ffffff) {
718 -+ error(U_REGEX_PATTERN_TOO_BIG);
719 -+ }
720 - if (fModeFlags & UREGEX_CASE_INSENSITIVE) {
721 -- op = URX_BUILD(URX_STRING_I, fRXPat->fLiteralText.length());
722 -+ appendOp(URX_STRING_I, fRXPat->fLiteralText.length());
723 - } else {
724 - // TODO here: add optimization to split case sensitive strings of length two
725 - // into two single char ops, for efficiency.
726 -- op = URX_BUILD(URX_STRING, fRXPat->fLiteralText.length());
727 -- }
728 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
729 -- op = URX_BUILD(URX_STRING_LEN, fLiteralChars.length());
730 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
731 -+ appendOp(URX_STRING, fRXPat->fLiteralText.length());
732 -+ }
733 -+ appendOp(URX_STRING_LEN, fLiteralChars.length());
734 -
735 - // Add this string into the accumulated strings of the compiled pattern.
736 -@@ -1891,6 +1820,56 @@
737 -
738 -
739 --
740 --
741 -+int32_t RegexCompile::buildOp(int32_t type, int32_t val) {
742 -+ if (U_FAILURE(*fStatus)) {
743 -+ return 0;
744 -+ }
745 -+ if (type < 0 || type > 255) {
746 -+ U_ASSERT(FALSE);
747 -+ error(U_REGEX_INTERNAL_ERROR);
748 -+ type = URX_RESERVED_OP;
749 -+ }
750 -+ if (val > 0x00ffffff) {
751 -+ U_ASSERT(FALSE);
752 -+ error(U_REGEX_INTERNAL_ERROR);
753 -+ val = 0;
754 -+ }
755 -+ if (val < 0) {
756 -+ if (!(type == URX_RESERVED_OP_N || type == URX_RESERVED_OP)) {
757 -+ U_ASSERT(FALSE);
758 -+ error(U_REGEX_INTERNAL_ERROR);
759 -+ return -1;
760 -+ }
761 -+ if (URX_TYPE(val) != 0xff) {
762 -+ U_ASSERT(FALSE);
763 -+ error(U_REGEX_INTERNAL_ERROR);
764 -+ return -1;
765 -+ }
766 -+ type = URX_RESERVED_OP_N;
767 -+ }
768 -+ return (type << 24) | val;
769 -+}
770 -+
771 -+
772 -+//------------------------------------------------------------------------------
773 -+//
774 -+// appendOp() Append a new instruction onto the compiled pattern
775 -+// Includes error checking, limiting the size of the
776 -+// pattern to lengths that can be represented in the
777 -+// 24 bit operand field of an instruction.
778 -+//
779 -+//------------------------------------------------------------------------------
780 -+void RegexCompile::appendOp(int32_t op) {
781 -+ if (U_FAILURE(*fStatus)) {
782 -+ return;
783 -+ }
784 -+ fRXPat->fCompiledPat->addElement(op, *fStatus);
785 -+ if ((fRXPat->fCompiledPat->size() > 0x00fffff0) && U_SUCCESS(*fStatus)) {
786 -+ error(U_REGEX_PATTERN_TOO_BIG);
787 -+ }
788 -+}
789 -+
790 -+void RegexCompile::appendOp(int32_t type, int32_t val) {
791 -+ appendOp(buildOp(type, val));
792 -+}
793 -
794 -
795 -@@ -1908,5 +1887,5 @@
796 - U_ASSERT(where>0 && where < code->size());
797 -
798 -- int32_t nop = URX_BUILD(URX_NOP, 0);
799 -+ int32_t nop = buildOp(URX_NOP, 0);
800 - code->insertElementAt(nop, where, *fStatus);
801 -
802 -@@ -1929,5 +1908,5 @@
803 - // needs to be incremented to adjust for the insertion.
804 - opValue++;
805 -- op = URX_BUILD(opType, opValue);
806 -+ op = buildOp(opType, opValue);
807 - code->setElementAt(op, loc);
808 - }
809 -@@ -1953,4 +1932,56 @@
810 - }
811 -
812 -+
813 -+//------------------------------------------------------------------------------
814 -+//
815 -+// allocateData() Allocate storage in the matcher's static data area.
816 -+// Return the index for the newly allocated data.
817 -+// The storage won't actually exist until we are running a match
818 -+// operation, but the storage indexes are inserted into various
819 -+// opcodes while compiling the pattern.
820 -+//
821 -+//------------------------------------------------------------------------------
822 -+int32_t RegexCompile::allocateData(int32_t size) {
823 -+ if (U_FAILURE(*fStatus)) {
824 -+ return 0;
825 -+ }
826 -+ if (size <= 0 || size > 0x100 || fRXPat->fDataSize < 0) {
827 -+ error(U_REGEX_INTERNAL_ERROR);
828 -+ return 0;
829 -+ }
830 -+ int32_t dataIndex = fRXPat->fDataSize;
831 -+ fRXPat->fDataSize += size;
832 -+ if (fRXPat->fDataSize >= 0x00fffff0) {
833 -+ error(U_REGEX_INTERNAL_ERROR);
834 -+ }
835 -+ return dataIndex;
836 -+}
837 -+
838 -+
839 -+//------------------------------------------------------------------------------
840 -+//
841 -+// allocateStackData() Allocate space in the back-tracking stack frame.
842 -+// Return the index for the newly allocated data.
843 -+// The frame indexes are inserted into various
844 -+// opcodes while compiling the pattern, meaning that frame
845 -+// size must be restricted to the size that will fit
846 -+// as an operand (24 bits).
847 -+//
848 -+//------------------------------------------------------------------------------
849 -+int32_t RegexCompile::allocateStackData(int32_t size) {
850 -+ if (U_FAILURE(*fStatus)) {
851 -+ return 0;
852 -+ }
853 -+ if (size <= 0 || size > 0x100 || fRXPat->fFrameSize < 0) {
854 -+ error(U_REGEX_INTERNAL_ERROR);
855 -+ return 0;
856 -+ }
857 -+ int32_t dataIndex = fRXPat->fFrameSize;
858 -+ fRXPat->fFrameSize += size;
859 -+ if (fRXPat->fFrameSize >= 0x00fffff0) {
860 -+ error(U_REGEX_PATTERN_TOO_BIG);
861 -+ }
862 -+ return dataIndex;
863 -+}
864 -
865 -
866 -@@ -1996,5 +2027,5 @@
867 - }
868 - if (reserveLoc) {
869 -- int32_t nop = URX_BUILD(URX_NOP, 0);
870 -+ int32_t nop = buildOp(URX_NOP, 0);
871 - fRXPat->fCompiledPat->insertElementAt(nop, theLoc, *fStatus);
872 - }
873 -@@ -2071,6 +2102,5 @@
874 -
875 - int32_t frameVarLocation = URX_VAL(captureOp);
876 -- int32_t endCaptureOp = URX_BUILD(URX_END_CAPTURE, frameVarLocation);
877 -- fRXPat->fCompiledPat->addElement(endCaptureOp, *fStatus);
878 -+ appendOp(URX_END_CAPTURE, frameVarLocation);
879 - }
880 - break;
881 -@@ -2083,6 +2113,5 @@
882 - U_ASSERT(URX_TYPE(stoOp) == URX_STO_SP);
883 - int32_t stoLoc = URX_VAL(stoOp);
884 -- int32_t ldOp = URX_BUILD(URX_LD_SP, stoLoc);
885 -- fRXPat->fCompiledPat->addElement(ldOp, *fStatus);
886 -+ appendOp(URX_LD_SP, stoLoc);
887 - }
888 - break;
889 -@@ -2093,6 +2122,5 @@
890 - U_ASSERT(URX_TYPE(startOp) == URX_LA_START);
891 - int32_t dataLoc = URX_VAL(startOp);
892 -- int32_t op = URX_BUILD(URX_LA_END, dataLoc);
893 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
894 -+ appendOp(URX_LA_END, dataLoc);
895 - }
896 - break;
897 -@@ -2104,10 +2132,7 @@
898 - U_ASSERT(URX_TYPE(startOp) == URX_LA_START);
899 - int32_t dataLoc = URX_VAL(startOp);
900 -- int32_t op = URX_BUILD(URX_LA_END, dataLoc);
901 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
902 -- op = URX_BUILD(URX_BACKTRACK, 0);
903 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
904 -- op = URX_BUILD(URX_LA_END, dataLoc);
905 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
906 -+ appendOp(URX_LA_END, dataLoc);
907 -+ appendOp(URX_BACKTRACK, 0);
908 -+ appendOp(URX_LA_END, dataLoc);
909 -
910 - // Patch the URX_SAVE near the top of the block.
911 -@@ -2116,5 +2141,5 @@
912 - U_ASSERT(URX_TYPE(saveOp) == URX_STATE_SAVE);
913 - int32_t dest = fRXPat->fCompiledPat->size()-1;
914 -- saveOp = URX_BUILD(URX_STATE_SAVE, dest);
915 -+ saveOp = buildOp(URX_STATE_SAVE, dest);
916 - fRXPat->fCompiledPat->setElementAt(saveOp, fMatchOpenParen);
917 - }
918 -@@ -2129,8 +2154,6 @@
919 - U_ASSERT(URX_TYPE(startOp) == URX_LB_START);
920 - int32_t dataLoc = URX_VAL(startOp);
921 -- int32_t op = URX_BUILD(URX_LB_END, dataLoc);
922 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
923 -- op = URX_BUILD(URX_LA_END, dataLoc);
924 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
925 -+ appendOp(URX_LB_END, dataLoc);
926 -+ appendOp(URX_LA_END, dataLoc);
927 -
928 - // Determine the min and max bounds for the length of the
929 -@@ -2168,6 +2191,5 @@
930 - U_ASSERT(URX_TYPE(startOp) == URX_LB_START);
931 - int32_t dataLoc = URX_VAL(startOp);
932 -- int32_t op = URX_BUILD(URX_LBN_END, dataLoc);
933 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
934 -+ appendOp(URX_LBN_END, dataLoc);
935 -
936 - // Determine the min and max bounds for the length of the
937 -@@ -2194,5 +2216,5 @@
938 - // Insert the pattern location to continue at after a successful match
939 - // as the last operand of the URX_LBN_CONT
940 -- op = URX_BUILD(URX_RELOC_OPRND, fRXPat->fCompiledPat->size());
941 -+ int32_t op = buildOp(URX_RELOC_OPRND, fRXPat->fCompiledPat->size());
942 - fRXPat->fCompiledPat->setElementAt(op, fMatchOpenParen-1);
943 - }
944 -@@ -2235,5 +2257,5 @@
945 - {
946 - // Set of no elements. Always fails to match.
947 -- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_BACKTRACK, 0), *fStatus);
948 -+ appendOp(URX_BACKTRACK, 0);
949 - delete theSet;
950 - }
951 -@@ -2256,6 +2278,5 @@
952 - int32_t setNumber = fRXPat->fSets->size();
953 - fRXPat->fSets->addElement(theSet, *fStatus);
954 -- int32_t setOp = URX_BUILD(URX_SETREF, setNumber);
955 -- fRXPat->fCompiledPat->addElement(setOp, *fStatus);
956 -+ appendOp(URX_SETREF, setNumber);
957 - }
958 - }
959 -@@ -2296,11 +2317,8 @@
960 - // +1 --> Input index (for breaking non-progressing loops)
961 - // (Only present if unbounded upper limit on loop)
962 -- int32_t counterLoc = fRXPat->fFrameSize;
963 -- fRXPat->fFrameSize++;
964 -- if (fIntervalUpper < 0) {
965 -- fRXPat->fFrameSize++;
966 -- }
967 --
968 -- int32_t op = URX_BUILD(InitOp, counterLoc);
969 -+ int32_t dataSize = fIntervalUpper < 0 ? 2 : 1;
970 -+ int32_t counterLoc = allocateStackData(dataSize);
971 -+
972 -+ int32_t op = buildOp(InitOp, counterLoc);
973 - fRXPat->fCompiledPat->setElementAt(op, topOfBlock);
974 -
975 -@@ -2310,5 +2328,5 @@
976 - // position to move.
977 - int32_t loopEnd = fRXPat->fCompiledPat->size();
978 -- op = URX_BUILD(URX_RELOC_OPRND, loopEnd);
979 -+ op = buildOp(URX_RELOC_OPRND, loopEnd);
980 - fRXPat->fCompiledPat->setElementAt(op, topOfBlock+1);
981 -
982 -@@ -2319,6 +2337,5 @@
983 - // Apend the CTR_LOOP op. The operand is the location of the CTR_INIT op.
984 - // Goes at end of the block being looped over, so just append to the code so far.
985 -- op = URX_BUILD(LoopOp, topOfBlock);
986 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
987 -+ appendOp(LoopOp, topOfBlock);
988 -
989 - if ((fIntervalLow & 0xff000000) != 0 ||
990 -@@ -2373,5 +2390,5 @@
991 - int32_t endOfSequenceLoc = fRXPat->fCompiledPat->size()-1
992 - + fIntervalUpper + (fIntervalUpper-fIntervalLow);
993 -- int32_t saveOp = URX_BUILD(URX_STATE_SAVE, endOfSequenceLoc);
994 -+ int32_t saveOp = buildOp(URX_STATE_SAVE, endOfSequenceLoc);
995 - if (fIntervalLow == 0) {
996 - insertOp(topOfBlock);
997 -@@ -2386,11 +2403,8 @@
998 - int32_t i;
999 - for (i=1; i<fIntervalUpper; i++ ) {
1000 -- if (i == fIntervalLow) {
1001 -- fRXPat->fCompiledPat->addElement(saveOp, *fStatus);
1002 -- }
1003 -- if (i > fIntervalLow) {
1004 -- fRXPat->fCompiledPat->addElement(saveOp, *fStatus);
1005 -- }
1006 -- fRXPat->fCompiledPat->addElement(op, *fStatus);
1007 -+ if (i >= fIntervalLow) {
1008 -+ appendOp(saveOp);
1009 -+ }
1010 -+ appendOp(op);
1011 - }
1012 - return TRUE;
1013 -@@ -3612,5 +3626,5 @@
1014 - U_ASSERT(operandAddress>=0 && operandAddress<deltas.size());
1015 - int32_t fixedOperandAddress = operandAddress - deltas.elementAti(operandAddress);
1016 -- op = URX_BUILD(opType, fixedOperandAddress);
1017 -+ op = buildOp(opType, fixedOperandAddress);
1018 - fRXPat->fCompiledPat->setElementAt(op, dst);
1019 - dst++;
1020 -@@ -3627,5 +3641,5 @@
1021 - }
1022 - where = fRXPat->fGroupMap->elementAti(where-1);
1023 -- op = URX_BUILD(opType, where);
1024 -+ op = buildOp(opType, where);
1025 - fRXPat->fCompiledPat->setElementAt(op, dst);
1026 - dst++;
1027 -@@ -3979,5 +3993,5 @@
1028 - //
1029 - // scanNamedChar
1030 -- // Get a UChar32 from a \N{UNICODE CHARACTER NAME} in the pattern.
1031 -+// Get a UChar32 from a \N{UNICODE CHARACTER NAME} in the pattern.
1032 - //
1033 - // The scan position will be at the 'N'. On return
1034 -Index: /icu/trunk/source/i18n/regexcmp.h
1035 -===================================================================
1036 ---- /icu/trunk/source/i18n/regexcmp.h (revision 36800)
1037 -+++ /icu/trunk/source/i18n/regexcmp.h (revision 36801)
1038 -@@ -105,4 +105,11 @@
1039 - void insertOp(int32_t where); // Open up a slot for a new op in the
1040 - // generated code at the specified location.
1041 -+ void appendOp(int32_t op); // Append a new op to the compiled pattern.
1042 -+ void appendOp(int32_t type, int32_t val); // Build & append a new op to the compiled pattern.
1043 -+ int32_t buildOp(int32_t type, int32_t val); // Construct a new pcode instruction.
1044 -+ int32_t allocateData(int32_t size); // Allocate space in the matcher data area.
1045 -+ // Return index of the newly allocated data.
1046 -+ int32_t allocateStackData(int32_t size); // Allocate space in the match back-track stack frame.
1047 -+ // Return offset index in the frame.
1048 - int32_t minMatchLength(int32_t start,
1049 - int32_t end);
1050 -Index: /icu/trunk/source/i18n/regeximp.h
1051 -===================================================================
1052 ---- /icu/trunk/source/i18n/regeximp.h (revision 36800)
1053 -+++ /icu/trunk/source/i18n/regeximp.h (revision 36801)
1054 -@@ -1,4 +1,4 @@
1055 - //
1056 --// Copyright (C) 2002-2013 International Business Machines Corporation
1057 -+// Copyright (C) 2002-2014 International Business Machines Corporation
1058 - // and others. All rights reserved.
1059 - //
1060 -@@ -242,5 +242,4 @@
1061 - // Convenience macros for assembling and disassembling a compiled operation.
1062 - //
1063 --#define URX_BUILD(type, val) (int32_t)((type << 24) | (val))
1064 - #define URX_TYPE(x) ((uint32_t)(x) >> 24)
1065 - #define URX_VAL(x) ((x) & 0xffffff)
1066 -Index: /icu/trunk/source/test/intltest/regextst.cpp
1067 -===================================================================
1068 ---- /icu/trunk/source/test/intltest/regextst.cpp (revision 36800)
1069 -+++ /icu/trunk/source/test/intltest/regextst.cpp (revision 36801)
1070 -@@ -145,4 +145,7 @@
1071 - if (exec) TestBug11049();
1072 - break;
1073 -+ case 25: name = "TestBug11371";
1074 -+ if (exec) TestBug11371();
1075 -+ break;
1076 - default: name = "";
1077 - break; //needed to end loop
1078 -@@ -5368,4 +5371,47 @@
1079 -
1080 -
1081 -+void RegexTest::TestBug11371() {
1082 -+ if (quick) {
1083 -+ logln("Skipping test. Runs in exhuastive mode only.");
1084 -+ return;
1085 -+ }
1086 -+ UErrorCode status = U_ZERO_ERROR;
1087 -+ UnicodeString patternString;
1088 -+
1089 -+ for (int i=0; i<8000000; i++) {
1090 -+ patternString.append(UnicodeString("()"));
1091 -+ }
1092 -+ LocalPointer<RegexPattern> compiledPat(RegexPattern::compile(patternString, 0, status));
1093 -+ if (status != U_REGEX_PATTERN_TOO_BIG) {
1094 -+ errln("File %s, line %d expected status=U_REGEX_PATTERN_TOO_BIG; got %s.",
1095 -+ __FILE__, __LINE__, u_errorName(status));
1096 -+ }
1097 -+
1098 -+ status = U_ZERO_ERROR;
1099 -+ patternString = "(";
1100 -+ for (int i=0; i<20000000; i++) {
1101 -+ patternString.append(UnicodeString("A++"));
1102 -+ }
1103 -+ patternString.append(UnicodeString("){0}B++"));
1104 -+ LocalPointer<RegexPattern> compiledPat2(RegexPattern::compile(patternString, 0, status));
1105 -+ if (status != U_REGEX_PATTERN_TOO_BIG) {
1106 -+ errln("File %s, line %d expected status=U_REGEX_PATTERN_TOO_BIG; got %s.",
1107 -+ __FILE__, __LINE__, u_errorName(status));
1108 -+ }
1109 -+
1110 -+ // Pattern with too much string data, such that string indexes overflow operand data field size
1111 -+ // in compiled instruction.
1112 -+ status = U_ZERO_ERROR;
1113 -+ patternString = "";
1114 -+ while (patternString.length() < 0x00ffffff) {
1115 -+ patternString.append(UnicodeString("stuff and things dont you know, these are a few of my favorite strings\n"));
1116 -+ }
1117 -+ patternString.append(UnicodeString("X? trailing string"));
1118 -+ LocalPointer<RegexPattern> compiledPat3(RegexPattern::compile(patternString, 0, status));
1119 -+ if (status != U_REGEX_PATTERN_TOO_BIG) {
1120 -+ errln("File %s, line %d expected status=U_REGEX_PATTERN_TOO_BIG; got %s.",
1121 -+ __FILE__, __LINE__, u_errorName(status));
1122 -+ }
1123 -+}
1124 -
1125 - #endif /* !UCONFIG_NO_REGULAR_EXPRESSIONS */
1126 -Index: /icu/trunk/source/test/intltest/regextst.h
1127 -===================================================================
1128 ---- /icu/trunk/source/test/intltest/regextst.h (revision 36800)
1129 -+++ /icu/trunk/source/test/intltest/regextst.h (revision 36801)
1130 -@@ -51,4 +51,5 @@
1131 - virtual void TestCaseInsensitiveStarters();
1132 - virtual void TestBug11049();
1133 -+ virtual void TestBug11371();
1134 -
1135 - // The following functions are internal to the regexp tests.
1136
1137 diff --git a/dev-libs/icu/icu-54.1-r1.ebuild b/dev-libs/icu/icu-54.1-r1.ebuild
1138 deleted file mode 100644
1139 index 3cf83ef..0000000
1140 --- a/dev-libs/icu/icu-54.1-r1.ebuild
1141 +++ /dev/null
1142 @@ -1,135 +0,0 @@
1143 -# Copyright 1999-2015 Gentoo Foundation
1144 -# Distributed under the terms of the GNU General Public License v2
1145 -# $Id$
1146 -
1147 -EAPI=5
1148 -
1149 -inherit eutils flag-o-matic toolchain-funcs autotools multilib-minimal
1150 -
1151 -DESCRIPTION="International Components for Unicode"
1152 -HOMEPAGE="http://www.icu-project.org/"
1153 -SRC_URI="http://download.icu-project.org/files/icu4c/${PV/_/}/icu4c-${PV//./_}-src.tgz"
1154 -
1155 -LICENSE="BSD"
1156 -
1157 -SLOT="0/54a"
1158 -
1159 -KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
1160 -IUSE="debug doc examples static-libs"
1161 -
1162 -DEPEND="
1163 - virtual/pkgconfig
1164 - doc? (
1165 - app-doc/doxygen[dot]
1166 - )
1167 -"
1168 -
1169 -S="${WORKDIR}/${PN}/source"
1170 -
1171 -MULTILIB_CHOST_TOOLS=(
1172 - /usr/bin/icu-config
1173 -)
1174 -
1175 -src_prepare() {
1176 - local variable
1177 -
1178 - epatch "${FILESDIR}/${PN}-remove-bashisms.patch"
1179 - epatch "${FILESDIR}/${P}-CVE-2014-9654.patch"
1180 - epatch_user
1181 -
1182 - # Disable renaming as it is stupind thing to do
1183 - sed -i \
1184 - -e "s/#define U_DISABLE_RENAMING 0/#define U_DISABLE_RENAMING 1/" \
1185 - common/unicode/uconfig.h || die
1186 -
1187 - # Fix linking of icudata
1188 - sed -i \
1189 - -e "s:LDFLAGSICUDT=-nodefaultlibs -nostdlib:LDFLAGSICUDT=:" \
1190 - config/mh-linux || die
1191 -
1192 - # Append doxygen configuration to configure
1193 - sed -i \
1194 - -e 's:icudefs.mk:icudefs.mk Doxyfile:' \
1195 - configure.ac || die
1196 -
1197 - eautoreconf
1198 -}
1199 -
1200 -src_configure() {
1201 - # Do _not_ use C++11 yet, make sure to force GNU C++ 98 standard.
1202 - append-cxxflags -std=gnu++98
1203 -
1204 - if tc-is-cross-compiler; then
1205 - mkdir "${WORKDIR}"/host || die
1206 - pushd "${WORKDIR}"/host >/dev/null || die
1207 -
1208 - CFLAGS="" CXXFLAGS="" ASFLAGS="" LDFLAGS="" \
1209 - CC="$(tc-getBUILD_CC)" CXX="$(tc-getBUILD_CXX)" AR="$(tc-getBUILD_AR)" \
1210 - RANLIB="$(tc-getBUILD_RANLIB)" LD="$(tc-getBUILD_LD)" \
1211 - "${S}"/configure --disable-renaming --disable-debug \
1212 - --disable-samples --enable-static || die
1213 - emake
1214 -
1215 - popd >/dev/null || die
1216 - fi
1217 -
1218 - multilib-minimal_src_configure
1219 -}
1220 -
1221 -multilib_src_configure() {
1222 - local myeconfargs=(
1223 - --disable-renaming
1224 - --disable-samples
1225 - $(use_enable debug)
1226 - $(use_enable static-libs static)
1227 - )
1228 -
1229 - multilib_is_native_abi && myeconfargs+=(
1230 - $(use_enable examples samples)
1231 - )
1232 - tc-is-cross-compiler && myeconfargs+=(
1233 - --with-cross-build="${WORKDIR}"/host
1234 - )
1235 -
1236 - # icu tries to use clang by default
1237 - tc-export CC CXX
1238 -
1239 - ECONF_SOURCE=${S} \
1240 - econf "${myeconfargs[@]}"
1241 -}
1242 -
1243 -multilib_src_compile() {
1244 - default
1245 -
1246 - if multilib_is_native_abi && use doc; then
1247 - doxygen -u Doxyfile || die
1248 - doxygen Doxyfile || die
1249 - fi
1250 -}
1251 -
1252 -multilib_src_test() {
1253 - # INTLTEST_OPTS: intltest options
1254 - # -e: Exhaustive testing
1255 - # -l: Reporting of memory leaks
1256 - # -v: Increased verbosity
1257 - # IOTEST_OPTS: iotest options
1258 - # -e: Exhaustive testing
1259 - # -v: Increased verbosity
1260 - # CINTLTST_OPTS: cintltst options
1261 - # -e: Exhaustive testing
1262 - # -v: Increased verbosity
1263 - emake -j1 VERBOSE="1" check
1264 -}
1265 -
1266 -multilib_src_install() {
1267 - default
1268 -
1269 - if multilib_is_native_abi && use doc; then
1270 - dohtml -p api -r doc/html/
1271 - fi
1272 -}
1273 -
1274 -multilib_src_install_all() {
1275 - einstalldocs
1276 - dohtml ../readme.html
1277 -}