diff options
author | Xinchen Hui <laruence@gmail.com> | 2017-02-25 12:00:57 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2017-02-25 12:00:57 +0800 |
commit | fa6144b077519529f24aa794a033f399b98a12f1 (patch) | |
tree | c6499e256a754c3363d32fbd81b641c8c4e7b752 /Zend/zend_execute_API.c | |
parent | 2c929943e6ccf4932677860a72201dc98bca121a (diff) | |
parent | 36fcc4cb5d92dabc8c8f6f0587c81093bcac878c (diff) | |
download | php-git-fa6144b077519529f24aa794a033f399b98a12f1.tar.gz |
Merge branch 'PHP-7.1'
* PHP-7.1:
Fixed bug #74164 (PHP hangs when an invalid value is dynamically passed to typehinted by-ref arg)
Fixed typo (it should be typo)
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r-- | Zend/zend_execute_API.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 9190eda9f0..7747fa4e58 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -763,6 +763,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / if (fci->object && (!EG(objects_store).object_buckets || !IS_OBJ_VALID(EG(objects_store).object_buckets[fci->object->handle]))) { + zend_vm_stack_free_call_frame(call); if (EG(current_execute_data) == &dummy_execute_data) { EG(current_execute_data) = dummy_execute_data.prev_execute_data; } @@ -772,6 +773,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / if (func->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { if (func->common.fn_flags & ZEND_ACC_ABSTRACT) { zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name)); + zend_vm_stack_free_call_frame(call); if (EG(current_execute_data) == &dummy_execute_data) { EG(current_execute_data) = dummy_execute_data.prev_execute_data; } @@ -782,6 +784,13 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / func->common.scope ? ZSTR_VAL(func->common.scope->name) : "", func->common.scope ? "::" : "", ZSTR_VAL(func->common.function_name)); + if (UNEXPECTED(EG(exception))) { + zend_vm_stack_free_call_frame(call); + if (EG(current_execute_data) == &dummy_execute_data) { + EG(current_execute_data) = dummy_execute_data.prev_execute_data; + } + return FAILURE; + } } } @@ -802,6 +811,15 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / func->common.scope ? ZSTR_VAL(func->common.scope->name) : "", func->common.scope ? "::" : "", ZSTR_VAL(func->common.function_name)); + if (UNEXPECTED(EG(exception))) { + ZEND_CALL_NUM_ARGS(call) = i; + zend_vm_stack_free_args(call); + zend_vm_stack_free_call_frame(call); + if (EG(current_execute_data) == &dummy_execute_data) { + EG(current_execute_data) = dummy_execute_data.prev_execute_data; + } + return FAILURE; + } } } } else { |