From: Nikita Popov Date: Sat, 22 Apr 2017 13:44:24 +0000 (+0200) Subject: Remove the ZEND_ACC_CLONE flag X-Git-Tag: php-7.2.0alpha1~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6a4aad82049c680ac5c224f675b5ffd44c642e5;p=php Remove the ZEND_ACC_CLONE flag This one is completely unused --- diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 926868d6a6..0274a288b6 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2381,7 +2381,6 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio dtor->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC; } if (clone) { - clone->common.fn_flags |= ZEND_ACC_CLONE; if (clone->common.fn_flags & ZEND_ACC_STATIC) { zend_error(error_type, "Constructor %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(clone->common.function_name)); } diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 09fd99ea31..35b15b3aef 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -6146,7 +6146,6 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */ } } if (ce->clone) { - ce->clone->common.fn_flags |= ZEND_ACC_CLONE; if (ce->clone->common.fn_flags & ZEND_ACC_STATIC) { zend_error_noreturn(E_COMPILE_ERROR, "Clone method %s::%s() cannot be static", ZSTR_VAL(ce->name), ZSTR_VAL(ce->clone->common.function_name)); diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 742a102391..370a57a1d7 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -205,6 +205,7 @@ typedef struct _zend_oparray_context { * Free flags: * 0x10 * 0x20 + * 0x8000 * 0x2000000 */ @@ -227,7 +228,6 @@ typedef struct _zend_oparray_context { /* method flags (special method detection) */ #define ZEND_ACC_CTOR 0x2000 #define ZEND_ACC_DTOR 0x4000 -#define ZEND_ACC_CLONE 0x8000 /* method flag used by Closure::__invoke() */ #define ZEND_ACC_USER_ARG_INFO 0x80 diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 5b5c9756e3..71b3eb06da 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -1103,7 +1103,7 @@ static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_ static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zend_function* fe) /* {{{ */ { if (zend_string_equals_literal(mname, ZEND_CLONE_FUNC_NAME)) { - ce->clone = fe; fe->common.fn_flags |= ZEND_ACC_CLONE; + ce->clone = fe; } else if (zend_string_equals_literal(mname, ZEND_CONSTRUCTOR_FUNC_NAME)) { if (ce->constructor && (!ce->parent || ce->constructor != ce->parent->constructor)) { zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ZSTR_VAL(ce->name));