cvs: ZendEngine2(PHP_5_3) / zend_compile.c zend_constants.c /tests constants_005.phpt

"Dmitry Stogov" <[email protected]>
Newsgroups gmane.comp.php.cvs.zend
Message-ID <cvsdmitry1217254339@cvsserver>
dmitry		Mon Jul 28 14:12:19 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /ZendEngine2/tests	constants_005.phpt 

  Modified files:              
    /ZendEngine2	zend_compile.c zend_constants.c 
  Log:
  Fixed constant substitution (Matt)
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.647.2.27.2.41.2.78&r2=1.647.2.27.2.41.2.79&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.78 ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.79
--- ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.78	Sat Jul 26 15:30:24 2008
+++ ZendEngine2/zend_compile.c	Mon Jul 28 14:12:19 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.78 2008/07/26 15:30:24 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.79 2008/07/28 14:12:19 dmitry Exp $ */
 
 #include <zend_language_parser.h>
 #include "zend.h"
@@ -3767,15 +3767,13 @@
 		char *lookup_name = zend_str_tolower_dup(Z_STRVAL_P(const_name), Z_STRLEN_P(const_name));
 		 
 		if (zend_hash_find(EG(zend_constants), lookup_name, Z_STRLEN_P(const_name)+1, (void **) &c)==SUCCESS) {
-			if ((c->flags & CONST_CS) && memcmp(c->name, Z_STRVAL_P(const_name), Z_STRLEN_P(const_name))!=0) {
+			if ((c->flags & CONST_CT_SUBST) && !(c->flags & CONST_CS)) {
 				efree(lookup_name);
-				return NULL;
+				return c;
 			}
-		} else {
-			efree(lookup_name);
-			return NULL;
 		}
 		efree(lookup_name);
+		return NULL;
 	}
 	if (c->flags & CONST_CT_SUBST) {
 		return c;
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_constants.c?r1=1.71.2.5.2.7.2.10&r2=1.71.2.5.2.7.2.11&diff_format=u
Index: ZendEngine2/zend_constants.c
diff -u ZendEngine2/zend_constants.c:1.71.2.5.2.7.2.10 ZendEngine2/zend_constants.c:1.71.2.5.2.7.2.11
--- ZendEngine2/zend_constants.c:1.71.2.5.2.7.2.10	Mon Jul 21 09:41:00 2008
+++ ZendEngine2/zend_constants.c	Mon Jul 28 14:12:19 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_constants.c,v 1.71.2.5.2.7.2.10 2008/07/21 09:41:00 bjori Exp $ */
+/* $Id: zend_constants.c,v 1.71.2.5.2.7.2.11 2008/07/28 14:12:19 dmitry Exp $ */
 
 #include "zend.h"
 #include "zend_constants.h"
@@ -231,7 +231,7 @@
 		lookup_name = zend_str_tolower_dup(name, name_len);
 
 		if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, (void **) &c)==SUCCESS) {
-			if ((c->flags & CONST_CS) && memcmp(c->name, name, name_len) != 0) {
+			if (c->flags & CONST_CS) {
 				retval=0;
 			}
 		} else {

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/constants_005.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/constants_005.phpt
+++ ZendEngine2/tests/constants_005.phpt



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.