[php-src] PR #22350: zend_ast: Escape control bytes in exported string literals
| From: | iliaal | Date: | Tue, 16 Jun 2026 23:01:21 +0000 |
| Subject: | [php-src] PR #22350: zend_ast: Escape control bytes in exported string literals | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36478@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22350
Author: iliaal
The AST pretty-printer rendered string literals single-quoted with raw bytes. A literal containing a
NUL kept the byte in the resulting zend_string, but assert() passes that string to
zend_throw_exception() as a const char*, so the failure message was truncated at the first NUL (the
rest of the expression was lost).
Render literals that contain a control byte double-quoted via zend_ast_export_qstr(), which escapes
those bytes as octal, so no embedded NUL survives and the message is complete. Strings without
control bytes are unchanged.
Fixes GH-22290