Skip to content

Commit 8126599

Browse files
committed
Drop dead abstract method check from zend_call_function()
zend_is_callable() is responsible for doing these kinds of checks already. Aldro drop a piece of obsolete commented out code.
1 parent 1be0563 commit 8126599

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

Zend/zend_execute_API.c

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -742,28 +742,18 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
742742
call = zend_vm_stack_push_call_frame(ZEND_CALL_TOP_FUNCTION | ZEND_CALL_DYNAMIC,
743743
func, fci->param_count, fci_cache->called_scope, fci->object);
744744

745-
if (func->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
746-
if (func->common.fn_flags & ZEND_ACC_ABSTRACT) {
747-
zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
745+
if (UNEXPECTED(func->common.fn_flags & ZEND_ACC_DEPRECATED)) {
746+
zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
747+
func->common.scope ? ZSTR_VAL(func->common.scope->name) : "",
748+
func->common.scope ? "::" : "",
749+
ZSTR_VAL(func->common.function_name));
750+
if (UNEXPECTED(EG(exception))) {
748751
zend_vm_stack_free_call_frame(call);
749752
if (EG(current_execute_data) == &dummy_execute_data) {
750753
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
751754
}
752755
return FAILURE;
753756
}
754-
if (func->common.fn_flags & ZEND_ACC_DEPRECATED) {
755-
zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
756-
func->common.scope ? ZSTR_VAL(func->common.scope->name) : "",
757-
func->common.scope ? "::" : "",
758-
ZSTR_VAL(func->common.function_name));
759-
if (UNEXPECTED(EG(exception))) {
760-
zend_vm_stack_free_call_frame(call);
761-
if (EG(current_execute_data) == &dummy_execute_data) {
762-
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
763-
}
764-
return FAILURE;
765-
}
766-
}
767757
}
768758

769759
for (i=0; i<fci->param_count; i++) {
@@ -844,12 +834,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
844834
EG(current_execute_data) = call->prev_execute_data;
845835
zend_vm_stack_free_args(call);
846836

847-
/* We shouldn't fix bad extensions here,
848-
because it can break proper ones (Bug #34045)
849-
if (!EX(function_state).function->common.return_reference)
850-
{
851-
INIT_PZVAL(f->retval);
852-
}*/
853837
if (EG(exception)) {
854838
zval_ptr_dtor(fci->retval);
855839
ZVAL_UNDEF(fci->retval);

0 commit comments

Comments
 (0)