Skip to content

Commit 40cd08f

Browse files
committed
Tweak
1 parent 4c41ad3 commit 40cd08f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/json/json_encoder.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,11 +585,14 @@ static zend_always_inline php_json_simd_result php_json_process_simd_block(
585585
*s += *pos;
586586
const char *s_backup = *s;
587587

588+
/* It's more important to keep this loop tight than to optimize this with
589+
* a trailing zero count. */
588590
for (; mask; mask >>= 1, *s += 1) {
589591
if (UNEXPECTED(mask & 1)) {
590592
bool handled = php_json_printable_ascii_escape(buf, (*s)[0], options);
591593
ZEND_ASSERT(handled);
592594
} else {
595+
ZEND_ASSERT(buf->s);
593596
smart_str_appendc(buf, (*s)[0]);
594597
}
595598
}

0 commit comments

Comments
 (0)