cvs: ZendEngine2 / zend_compile.c

From: Date: Sun, 04 May 2003 18:56:36 +0000
Subject: cvs: ZendEngine2 / zend_compile.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1187@lists.php.net to get a copy of this message
helly Sun May 4 14:56:36 2003 EDT Modified files: /ZendEngine2 zend_compile.c Log: Don't inherit twice what is needed only once Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.413 ZendEngine2/zend_compile.c:1.414 --- ZendEngine2/zend_compile.c:1.413 Sun Apr 20 10:52:40 2003 +++ ZendEngine2/zend_compile.c Sun May 4 14:56:35 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.413 2003/04/20 14:52:40 sterling Exp $ */ +/* $Id: zend_compile.c,v 1.414 2003/05/04 18:56:35 helly Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -1617,17 +1617,19 @@ return; } - if (!zend_hash_exists(&ce->function_table, ce->name, ce->name_length+1)) { - if (zend_hash_find(&ce->parent->function_table, ce->parent->name, ce->parent->name_length+1, (void **) &function)==SUCCESS) { - /* inherit parent's constructor */ - zend_hash_update(&ce->function_table, ce->name, ce->name_length+1, function, sizeof(zend_function), NULL); - function_add_ref(function); - } - } if (zend_hash_find(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), (void **) &function)==SUCCESS) { /* inherit parent's constructor */ zend_hash_update(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, sizeof(zend_function), NULL); function_add_ref(function); + } else { + /* don't inherit the old style constructor if we already have the new style cconstructor */ + if (!zend_hash_exists(&ce->function_table, ce->name, ce->name_length+1)) { + if (zend_hash_find(&ce->parent->function_table, ce->parent->name, ce->parent->name_length+1, (void **) &function)==SUCCESS) { + /* inherit parent's constructor */ + zend_hash_update(&ce->function_table, ce->name, ce->name_length+1, function, sizeof(zend_function), NULL); + function_add_ref(function); + } + } } ce->constructor = ce->parent->constructor; if (!ce->__get) {

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