cvs: ZendEngine2 / zend_compile.c

From: Date: Sun, 23 Feb 2003 13:58:49 +0000
Subject: cvs: ZendEngine2 / zend_compile.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-958@lists.php.net to get a copy of this message
zeev Sun Feb 23 08:58:49 2003 EDT Modified files: /ZendEngine2 zend_compile.c Log: Move abstract inheritance logic to the right spot Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.371 ZendEngine2/zend_compile.c:1.372 --- ZendEngine2/zend_compile.c:1.371 Sun Feb 23 07:51:40 2003 +++ ZendEngine2/zend_compile.c Sun Feb 23 08:58:48 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.371 2003/02/23 12:51:40 zeev Exp $ */ +/* $Id: zend_compile.c,v 1.372 2003/02/23 13:58:48 zeev Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -1580,26 +1580,26 @@ } -static void do_inherit_method(zend_function *function, zend_class_entry *ce) +static void do_inherit_method(zend_function *function) { /* The class entry of the derived function intentionally remains the same * as that of the parent class. That allows us to know in which context * we're running, and handle private method calls properly. */ - if (function->common.fn_flags & ZEND_ACC_ABSTRACT) { - ce->ce_flags |= ZEND_ACC_ABSTRACT; - } function_add_ref(function); } -static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_function *parent, zend_hash_key *hash_key, void *pData) +static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_function *parent, zend_hash_key *hash_key, zend_class_entry *child_ce) { zend_uint child_flags; zend_uint parent_flags = parent->common.fn_flags; zend_function *child; if (zend_hash_quick_find(child_function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **) &child)==FAILURE) { + if (parent_flags & ZEND_ACC_ABSTRACT) { + child_ce->ce_flags |= ZEND_ACC_ABSTRACT; + } return 1; /* method doesn't exist in child, copy from parent */ } child_flags = child->common.fn_flags; @@ -1613,8 +1613,7 @@ } } - /* Disallow making an inherited method abstract. - */ + /* Disallow making an inherited method abstract. */ if ((child_flags & ZEND_ACC_ABSTRACT) && !(parent_flags & ZEND_ACC_ABSTRACT)) { zend_error(E_COMPILE_ERROR, "Cannot make non abstract method %s::%s() abstract in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); }

« previous php.zend-engine.cvs (#958) next »