Save opline in leave helper to correctly handle destructor calls
during CV freeing (or other leave freeing).
- Core:
. Fixed bug #78929 (plus signs in cookie values are converted to spaces).
(Alexey Kachalin)
+ . Fixed bug #78973 (Destructor during CV freeing causes segfault if opline
+ never saved). (Nikita)
- OPcache:
. Fixed bug #78961 (erroneous optimization of re-assigned $GLOBALS). (Dmitry)
--- /dev/null
+--TEST--
+Bug #78973: Destructor during CV freeing causes segfault if opline never saved
+--FILE--
+<?php
+
+function test($x) {
+}
+test(new class {
+ public function __destruct() {
+ debug_print_backtrace();
+ }
+});
+
+?>
+--EXPECTF--
+#0 class@anonymous->__destruct() called at [%s:4]
+#1 test() called at [%s:5]
{
zend_execute_data *old_execute_data;
uint32_t call_info = EX_CALL_INFO();
+ SAVE_OPLINE();
if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
i_free_compiled_variables(execute_data);
{
zend_execute_data *old_execute_data;
uint32_t call_info = EX_CALL_INFO();
+ SAVE_OPLINE();
if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
i_free_compiled_variables(execute_data);
{
zend_execute_data *old_execute_data;
uint32_t call_info = EX_CALL_INFO();
+ SAVE_OPLINE();
if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
i_free_compiled_variables(execute_data);