Skip to content

Commit ceb8443

Browse files
committed
skip extra check
1 parent d5c5b9f commit ceb8443

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/json/json_encoder.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,10 @@ zend_result php_json_escape_string(
587587
int input_range_mask = _mm_movemask_epi8(input_range);
588588
if (input_range_mask != 0) {
589589
max_shift = zend_ulong_ntz(input_range_mask);
590-
if (max_shift <= 1) {
590+
if (UNEXPECTED(max_shift <= 1)) {
591591
/* not worth it */
592-
break;
592+
us = (unsigned char)s[pos];
593+
goto fallback;
593594
}
594595
}
595596

@@ -650,6 +651,7 @@ zend_result php_json_escape_string(
650651
pos++;
651652
len--;
652653
} else {
654+
fallback:;
653655
if (UNEXPECTED(us >= 0x80)) {
654656
zend_result status;
655657
size_t pos_old = pos;

0 commit comments

Comments
 (0)