diff options
author | Dmitry Stogov <dmitry@zend.com> | 2019-02-07 21:05:46 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2019-02-07 21:05:46 +0300 |
commit | f45e0ce928e1d02e872d8805f4476a1ba072e8d1 (patch) | |
tree | 1d809b6432a5fc653ecd4b5cb3f53faf5e04daff /Zend/zend_execute_API.c | |
parent | 2306c855abf504579aa2d2ca732dbb8c44d17f29 (diff) | |
download | php-git-f45e0ce928e1d02e872d8805f4476a1ba072e8d1.tar.gz |
Remove ZEND_OVERLOADED_FUNCTION and corresponding call_method object handler
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r-- | Zend/zend_execute_API.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index fb6faad8af..de85e2ea6c 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -772,8 +772,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / /* We must re-initialize function again */ fci_cache->function_handler = NULL; } - } else if (func->type == ZEND_INTERNAL_FUNCTION) { + } else { int call_via_handler = (func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) != 0; + + ZEND_ASSERT(func->type == ZEND_INTERNAL_FUNCTION); ZVAL_NULL(fci->retval); call->prev_execute_data = EG(current_execute_data); call->return_value = NULL; /* this is not a constructor call */ @@ -796,30 +798,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / /* We must re-initialize function again */ fci_cache->function_handler = NULL; } - } else { /* ZEND_OVERLOADED_FUNCTION */ - ZVAL_NULL(fci->retval); - - /* Not sure what should be done here if it's a static method */ - if (fci->object) { - call->prev_execute_data = EG(current_execute_data); - EG(current_execute_data) = call; - fci->object->handlers->call_method(func->common.function_name, fci->object, call, fci->retval); - EG(current_execute_data) = call->prev_execute_data; - } else { - zend_throw_error(NULL, "Cannot call overloaded function for non-object"); - } - - zend_vm_stack_free_args(call); - - if (func->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) { - zend_string_release_ex(func->common.function_name, 0); - } - efree(func); - - if (EG(exception)) { - zval_ptr_dtor(fci->retval); - ZVAL_UNDEF(fci->retval); - } } zend_vm_stack_free_call_frame(call); |