@@ -213,17 +213,13 @@ std:
213
213
s->str_esc += 4;
214
214
PHP_JSON_CONDITION_GOTO(STR_P1);
215
215
}
216
- <STR_P1>UTF16_3 {
217
- s->str_esc += 3;
218
- PHP_JSON_CONDITION_GOTO(STR_P1);
219
- }
220
216
<STR_P1>UTF16_4 {
221
217
s->str_esc += 8;
222
218
PHP_JSON_CONDITION_GOTO(STR_P1);
223
219
}
224
220
<STR_P1>UCS2 {
225
- s->errcode = PHP_JSON_ERROR_UTF16 ;
226
- return PHP_JSON_T_ERROR ;
221
+ s->str_esc += 3 ;
222
+ PHP_JSON_CONDITION_GOTO(STR_P1) ;
227
223
}
228
224
<STR_P1>ESC {
229
225
s->str_esc++;
@@ -276,15 +272,6 @@ std:
276
272
s->str_start = s->cursor;
277
273
PHP_JSON_CONDITION_GOTO(STR_P2);
278
274
}
279
- <STR_P2>UTF16_3 {
280
- int utf16 = php_json_ucs2_to_int(s, 4);
281
- PHP_JSON_SCANNER_COPY_UTF();
282
- *(s->pstr++) = (char) (0xe0 | (utf16 >> 12));
283
- *(s->pstr++) = (char) (0x80 | ((utf16 >> 6) & 0x3f));
284
- *(s->pstr++) = (char) (0x80 | (utf16 & 0x3f));
285
- s->str_start = s->cursor;
286
- PHP_JSON_CONDITION_GOTO(STR_P2);
287
- }
288
275
<STR_P2>UTF16_4 {
289
276
int utf32, utf16_hi, utf16_lo;
290
277
utf16_hi = php_json_ucs2_to_int(s, 4);
@@ -298,6 +285,15 @@ std:
298
285
s->str_start = s->cursor;
299
286
PHP_JSON_CONDITION_GOTO(STR_P2);
300
287
}
288
+ <STR_P2>UCS2 {
289
+ int utf16 = php_json_ucs2_to_int(s, 4);
290
+ PHP_JSON_SCANNER_COPY_UTF();
291
+ *(s->pstr++) = (char) (0xe0 | (utf16 >> 12));
292
+ *(s->pstr++) = (char) (0x80 | ((utf16 >> 6) & 0x3f));
293
+ *(s->pstr++) = (char) (0x80 | (utf16 & 0x3f));
294
+ s->str_start = s->cursor;
295
+ PHP_JSON_CONDITION_GOTO(STR_P2);
296
+ }
301
297
<STR_P2>ESCPREF {
302
298
char esc;
303
299
PHP_JSON_SCANNER_COPY_ESC();
0 commit comments