We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3baa23 commit 3c8b68eCopy full SHA for 3c8b68e
ext/json/json_encoder.c
@@ -561,10 +561,9 @@ zend_result php_json_escape_string(
561
break;
562
}
563
564
- int shift = zend_ulong_nlz(mask) - 16 - (SIZEOF_ZEND_LONG == 8 ? 32 : 0); /* skips over everything */
565
smart_str_appendl(buf, s, pos);
566
s += pos;
567
- pos = shift;
+ const char *s_backup = s;
568
569
do {
570
/* Note that we shift the input forward, so we have to shift the mask as well,
@@ -580,6 +579,8 @@ zend_result php_json_escape_string(
580
579
bool handled = php_json_printable_ascii_escape(buf, us, options);
581
ZEND_ASSERT(handled == true);
582
} while (mask != 0);
+
583
+ pos = 16 - (s - s_backup);
584
} else {
585
if (max_shift < 16) {
586
pos += max_shift;
0 commit comments