cvs: ZendEngine2 / zend_compile.c

[email protected] ("Felipe Pena")
Newsgroups php.zend-engine.cvs
Message-ID <cvsfelipe1206132082@cvsserver>
felipe		Fri Mar 21 20:41:22 2008 UTC

  Modified files:              
    /ZendEngine2	zend_compile.c 
  Log:
  - Simplify zend_do_build_namespace_name()
  - Fix macro (Z_USTRLEN/Z_STRLEN -> Z_UNILEN) in zend_do_fetch_class_name()
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.814&r2=1.815&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.814 ZendEngine2/zend_compile.c:1.815
--- ZendEngine2/zend_compile.c:1.814	Tue Mar 18 11:37:15 2008
+++ ZendEngine2/zend_compile.c	Fri Mar 21 20:41:22 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_compile.c,v 1.814 2008/03/18 11:37:15 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.815 2008/03/21 20:41:22 felipe Exp $ */
 
 #include <zend_language_parser.h>
 #include "zend.h"
@@ -1842,7 +1842,7 @@
 		*result = *class_name_entry;
 	}
 
-	length = sizeof("::")-1 + Z_USTRLEN(result->u.constant) + Z_USTRLEN(class_name->u.constant);
+	length = sizeof("::")-1 + Z_UNILEN(result->u.constant) + Z_UNILEN(class_name->u.constant);
 	if (Z_TYPE(result->u.constant) == IS_UNICODE) {
 		Z_USTRVAL(result->u.constant) = erealloc(Z_USTRVAL(result->u.constant), UBYTES(length+1));
 		Z_USTRVAL(result->u.constant)[Z_USTRLEN(result->u.constant)] = ':';
@@ -1855,7 +1855,7 @@
 		memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant) + sizeof("::")-1], Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant)+1);
 		STR_FREE(Z_STRVAL(class_name->u.constant));
 	}
-	Z_STRLEN(result->u.constant) = length;
+	Z_UNILEN(result->u.constant) = length;
 }
 /* }}} */
 
@@ -5238,24 +5238,8 @@
 		Z_UNIVAL(result->u.constant) = NULL_ZSTR;
 		Z_UNILEN(result->u.constant) = 0;
 	}
-	len = Z_UNILEN(result->u.constant) + 2 + Z_UNILEN(name->u.constant);
-	if (UG(unicode)) {
-		Z_USTRVAL(result->u.constant) = eurealloc(Z_USTRVAL(result->u.constant), len + 1);
-		Z_USTRVAL(result->u.constant)[Z_USTRLEN(result->u.constant)] = ':';
-		Z_USTRVAL(result->u.constant)[Z_USTRLEN(result->u.constant)+1] = ':';
-		memcpy(Z_USTRVAL(result->u.constant)+Z_USTRLEN(result->u.constant)+2,
-			Z_USTRVAL(name->u.constant),
-			UBYTES(Z_USTRLEN(name->u.constant)+1));
-	} else {
-		Z_USTRVAL(result->u.constant) = erealloc(Z_STRVAL(result->u.constant), len + 1);
-		Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant)] = ':';
-		Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant)+1] = ':';
-		memcpy(Z_STRVAL(result->u.constant)+Z_STRLEN(result->u.constant)+2,
-			Z_STRVAL(name->u.constant),
-			Z_USTRLEN(name->u.constant)+1);
-	}
-	Z_UNILEN(result->u.constant) = len;
-	zval_dtor(&name->u.constant);
+	/* prefix = result */
+	zend_do_fetch_class_name(NULL, result, name TSRMLS_CC);
 }
 /* }}} */
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.