[php-src] PR #22494: Memoize pipe operator on the lhs of coalesce assignment
| From: | iliaal | Date: | Sat, 27 Jun 2026 23:42:00 +0000 |
| Subject: | [php-src] PR #22494: Memoize pipe operator on the lhs of coalesce assignment | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36704@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22494
Author: iliaal
A pipe expression on the left-hand side of
??=, e.g. (1 |> f(...))->g ??=
2, crashes the compiler with a NULL pointer dereference in
zend_compile_memoized_expr. The coalesce-assign LHS is compiled twice and call results
are memoized by AST-node pointer, but zend_compile_pipe desugars the pipe into a
freshly allocated call node on each pass, so the fetch pass looks up a pointer the compile pass
never stored. Memoizing the whole pipe under its stable original node, consistent with
zend_is_call(), makes the pipe compile once and the fetch pass reuse the result.
Fixes #22490