mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
Fix Closure leak in aborted INIT_DYNAMIC_FCALL
This commit is contained in:
parent
bc0df38e88
commit
1335ebd068
2 changed files with 17 additions and 0 deletions
14
Zend/tests/closure_call_leak_with_exception.phpt
Normal file
14
Zend/tests/closure_call_leak_with_exception.phpt
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
--FILE--
|
||||||
|
Closure must not leak during a dynmaic call interrupted by an exception
|
||||||
|
--TEST--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
$closure = function($foo) { var_dump($foo); };
|
||||||
|
$closure(yield);
|
||||||
|
})()->valid(); // start
|
||||||
|
|
||||||
|
?>
|
||||||
|
==DONE==
|
||||||
|
--EXPECT--
|
||||||
|
==DONE==
|
|
@ -2486,6 +2486,9 @@ static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data
|
||||||
}
|
}
|
||||||
OBJ_RELEASE(Z_OBJ(call->This));
|
OBJ_RELEASE(Z_OBJ(call->This));
|
||||||
}
|
}
|
||||||
|
if (call->func->common.fn_flags & ZEND_ACC_CLOSURE) {
|
||||||
|
zend_object_release(call->func->common.prototype);
|
||||||
|
}
|
||||||
if (call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
|
if (call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
|
||||||
zend_string_release(call->func->common.function_name);
|
zend_string_release(call->func->common.function_name);
|
||||||
zend_free_trampoline(call->func);
|
zend_free_trampoline(call->func);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue