summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-11-10 10:10:39 +0300
committerAnatol Belski <ab@php.net>2015-11-10 12:09:45 +0100
commit2f8b6ebddc3dff2e8889fd54c5006c4007f8a29b (patch)
treee542bf8390fd47caf95046f8722fc9378343de2d /Zend/zend_execute.c
parent17d9bc9222ced1b97603d219ba96675e43775b1d (diff)
downloadphp-git-2f8b6ebddc3dff2e8889fd54c5006c4007f8a29b.tar.gz
Fixed incorrect order of free/finally on exception
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index bbeab75175..0e2431199f 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -2418,7 +2418,7 @@ static zend_always_inline zend_generator *zend_get_running_generator(zend_execut
}
/* }}} */
-static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) /* {{{ */
+static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t op_num) /* {{{ */
{
int i;
if (UNEXPECTED(EX(call))) {
@@ -2543,6 +2543,12 @@ static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data
call = EX(call);
} while (call);
}
+}
+/* }}} */
+
+static void cleanup_live_vars(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) /* {{{ */
+{
+ int i;
for (i = 0; i < EX(func)->op_array.last_brk_cont; i++) {
const zend_brk_cont_element *brk_cont = &EX(func)->op_array.brk_cont_array[i];
@@ -2592,7 +2598,8 @@ static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data
/* }}} */
void zend_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) {
- i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
+ cleanup_unfinished_calls(execute_data, op_num);
+ cleanup_live_vars(execute_data, op_num, catch_op_num);
}
#ifdef HAVE_GCC_GLOBAL_REGS