[php-src] PR #25784: Fix GH-25779: mysqli_fetch_object() crashes with JIT when the constructor keeps a reference and the result is discarded
| From: | thunderer | Date: | Thu, 26 Nov 2026 12:48:53 +0000 |
| Subject: | [php-src] PR #25784: Fix GH-25779: mysqli_fetch_object() crashes with JIT when the constructor keeps a reference and the result is discarded | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41049@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25784
Author: thunderer
Fixes GH-25779.
mysqli_fetch_object() calls the constructor on the object it returns, and the
constructor can keep a reference to $this. The stub still declared @refcount
1, so function JIT and tracing JIT destroyed the object when the result was discarded, while
that reference still used it.
This drops the annotation and regenerates the arginfo and optimizer info, as c7265742d06 did for
pg_fetch_object(). The test fails without the change. The method
mysqli_result::fetch_object() is not in the optimizer info and is not affected.
The merge into PHP-8.5 and PHP-8.6 conflicts only in the stub hash line of
ext/mysqli/mysqli_arginfo.h; build/gen_stub.php regenerates it.