[php-src] PR #16200: Ignore scope when compiling closure in non-tracing jit
| From: | arnaud-lb | Date: | Thu, 03 Oct 2024 16:02:18 +0000 |
| Subject: | [php-src] PR #16200: Ignore scope when compiling closure in non-tracing jit | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-28977@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/16200
Author: arnaud-lb
Fixes GH-16186.
zend_jit() assumes that the op_array of Closures have no scope, but this is not true
for all triggers. E.g. with the hot counter trigger, the op_array is a copy with a scope.
As a result, we assume the class of $this
[here](https://github.com/php/php-src/blob/2d8a93cbb66585cedfe27b828b2839f0aea9a691/ext/opcache/jit/zend_jit.c#L1749),
but it is later changed in ::bind(), which causes the issue.
Here I copy what is done for the tracing JIT: Use the original op_array, which has no scope.