cvs: ZendEngine2(PHP_5_0) / zend_compile.c /tests bug33732.phpt php-src NEWS

From: Date: Wed, 23 Nov 2005 09:26:23 +0000
Subject: cvs: ZendEngine2(PHP_5_0) / zend_compile.c /tests bug33732.phpt php-src NEWS
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4379@lists.php.net to get a copy of this message
dmitry Wed Nov 23 04:26:23 2005 EDT Added files: (Branch: PHP_5_0) /ZendEngine2/tests bug33732.phpt Modified files: /php-src NEWS /ZendEngine2 zend_compile.c Log: Fixed bug #33732 (Wrong behavior of constants in class and interface extending) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.520&r2=1.1760.2.521&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.520 php-src/NEWS:1.1760.2.521 --- php-src/NEWS:1.1760.2.520 Fri Nov 18 16:23:45 2005 +++ php-src/NEWS Wed Nov 23 04:26:18 2005 @@ -53,6 +53,8 @@ (Marcus) - Fixed bug #34199 (if($obj)/if(!$obj) inconsistency because of cast handler). (Dmitry, Alex) +- Fixed bug #33732 (Wrong behavior of constants in class and interface + extending). (Dmitry) - Fixed bug #33720 (mb_encode_mimeheader does not work for multibyte chars). (Rui) - Fixed bug #33383 (crash when retrieving empty LOBs). (Tony) http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.567.2.31&r2=1.567.2.32&ty=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.567.2.31 ZendEngine2/zend_compile.c:1.567.2.32 --- ZendEngine2/zend_compile.c:1.567.2.31 Tue Sep 20 07:38:37 2005 +++ ZendEngine2/zend_compile.c Wed Nov 23 04:26:20 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.567.2.31 2005/09/20 11:38:37 tony2001 Exp $ */ +/* $Id: zend_compile.c,v 1.567.2.32 2005/11/23 09:26:20 dmitry Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -2027,10 +2027,14 @@ } -static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zval *parent_constant, zend_hash_key *hash_key, zend_class_entry *iface) +static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zval **parent_constant, zend_hash_key *hash_key, zend_class_entry *iface) { - if (zend_hash_quick_exists(child_constants_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h)) { - zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited constant %s from interface %s", hash_key->arKey, iface->name); + zval **old_constant; + + if (zend_hash_quick_find(child_constants_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void**)&old_constant) == SUCCESS) { + if (*old_constant != *parent_constant) { + zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited constant %s from interface %s", hash_key->arKey, iface->name); + } return 0; } return 1; http://cvs.php.net/co.php/ZendEngine2/tests/bug33732.phpt?r=1.1&p=1 Index: ZendEngine2/tests/bug33732.phpt +++ ZendEngine2/tests/bug33732.phpt

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