History log of /PHP-8.3/ext/opcache/tests/jit/closure_001.phpt (Results 1 – 1 of 1)
Revision Date Author Comments
# 45cb3f91 21-Nov-2022 Dmitry Stogov

Fix a memory leak in tracig JIT when the same closure is called through Closure::call() and natively.

Closure::call() makes a temporary copy of original closure function, modifies its
sc

Fix a memory leak in tracig JIT when the same closure is called through Closure::call() and natively.

Closure::call() makes a temporary copy of original closure function, modifies its
scope, resets ZEND_ACC_CLOSURE flag and call it through zend_call_function().
As result the same function may be called with and without
ZEND_ACC_CLOSURE flag, that confuses JIT and may lead to memory leak or
even worse memory errors.

The patch allocates "fake" closure object and keep ZEND_ACC_CLOSURE flag
to always behave in the same way.

show more ...