]> granicus.if.org Git - php/commitdiff
- Fix function copying (in TSRM mode)
authorMarcus Boerger <helly@php.net>
Sun, 13 Jul 2008 21:30:18 +0000 (21:30 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 13 Jul 2008 21:30:18 +0000 (21:30 +0000)
Zend/zend.c

index 3aee2296c07a9637f62b340718e96bbc2bfaf527..e2a1cacfe5e6827b9b887049f6c210f85c6d8e68 100644 (file)
@@ -737,12 +737,16 @@ static void free_u_zend_constant(zend_constant *c) /* {{{ */
 static void function_to_unicode(zend_function *func TSRMLS_DC) /* {{{ */
 {
        if (func->common.function_name.s) {
-               UChar *uname;
-               int len = strlen(func->common.function_name.s) + 1;
-
-               uname = malloc(UBYTES(len));
-               u_charsToUChars(func->common.function_name.s, uname, len);
-               func->common.function_name.u = uname;
+               if (UG(unicode)) {
+                       func->common.function_name.u = zend_ustrdup(func->common.function_name.u);
+               } else {
+                       UChar *uname;
+                       int len = strlen(func->common.function_name.s) + 1;
+       
+                       uname = malloc(UBYTES(len));
+                       u_charsToUChars(func->common.function_name.s, uname, len);
+                       func->common.function_name.u = uname;
+               }
        }
        if (func->common.arg_info) {
                zend_arg_info *args;