cvs: ZendEngine2 / zend_API.h

From: Date: Thu, 19 Oct 2006 18:27:35 +0000
Subject: cvs: ZendEngine2 / zend_API.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5340@lists.php.net to get a copy of this message
andrei Thu Oct 19 18:27:35 2006 UTC Modified files: /ZendEngine2 zend_API.h Log: Fix possible double macro expansion. http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.h?r1=1.264&r2=1.265&diff_format=u Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.264 ZendEngine2/zend_API.h:1.265 --- ZendEngine2/zend_API.h:1.264 Tue Oct 17 22:15:19 2006 +++ ZendEngine2/zend_API.h Thu Oct 19 18:27:35 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.264 2006/10/17 22:15:19 andrei Exp $ */ +/* $Id: zend_API.h,v 1.265 2006/10/19 18:27:35 andrei Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -405,11 +405,12 @@ #define add_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \ if (UG(unicode)) { \ - UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + int ___u_len = length; \ + UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \ if ((flags) & ZSTR_AUTOFREE) { \ efree(str); \ } \ - add_assoc_unicodel_ex(arg, key, key_len, ___u_str, length, 0); \ + add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \ } else { \ add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ @@ -547,11 +548,12 @@ #define add_ascii_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \ if (UG(unicode)) { \ - UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + int ___u_len = length; \ + UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \ if ((flags) & ZSTR_AUTOFREE) { \ efree(str); \ } \ - add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, length, 0); \ + add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \ } else { \ add_ascii_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ @@ -690,11 +692,12 @@ #define add_rt_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \ if (UG(unicode)) { \ - UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + int ___u_len = length; \ + UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \ if ((flags) & ZSTR_AUTOFREE) { \ efree(str); \ } \ - add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, length, 0); \ + add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \ } else { \ add_rt_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ @@ -833,11 +836,12 @@ #define add_utf8_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \ if (UG(unicode)) { \ - UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + int ___u_len = length; \ + UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \ if ((flags) & ZSTR_AUTOFREE) { \ efree(str); \ } \ - add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, length, 0); \ + add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \ } else { \ add_utf8_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ @@ -986,11 +990,12 @@ #define add_utf8_property_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \ if (UG(unicode)) { \ - UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + int ___u_len = length; \ + UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \ if ((flags) & ZSTR_AUTOFREE) { \ efree(str); \ } \ - add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, length, 0); \ + add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \ } else { \ add_utf8_property_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ @@ -1103,11 +1108,12 @@ #define add_u_assoc_ascii_stringl_ex(arg, type, key, key_len, str, length, flags) do { \ if (UG(unicode)) { \ - UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + int ___u_len = length; \ + UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \ if ((flags) & ZSTR_AUTOFREE) { \ efree(str); \ } \ - add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, length, 0); \ + add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \ } else { \ add_u_assoc_stringl_ex(arg, type, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ @@ -1246,11 +1252,12 @@ #define add_index_ascii_stringl(arg, idx, str, length, flags) do { \ if (UG(unicode)) { \ - UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + int ___u_len; \ + UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \ if ((flags) & ZSTR_AUTOFREE) { \ efree(str); \ } \ - add_index_unicodel(arg, idx, ___u_str, length, 0); \ + add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \ } else { \ add_index_stringl(arg, idx, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ @@ -1368,11 +1375,12 @@ #define add_next_index_ascii_stringl(arg, str, length, flags) do { \ if (UG(unicode)) { \ - UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \ + int ___u_len = length; \ + UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \ if ((flags) & ZSTR_AUTOFREE) { \ efree(str); \ } \ - add_next_index_unicodel(arg, ___u_str, length, 0); \ + add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \ } else { \ add_next_index_stringl(arg, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \ } \ @@ -1606,11 +1614,12 @@ #define ZVAL_ASCII_STRINGL(z, s, l, flags) \ if (UG(unicode)) { \ - UChar *u_str = zend_ascii_to_unicode((s), (l)+1 ZEND_FILE_LINE_CC); \ + int u_len = l; \ + UChar *u_str = zend_ascii_to_unicode((s), (u_len)+1 ZEND_FILE_LINE_CC); \ if ((flags) & ZSTR_AUTOFREE) { \ efree(s); \ } \ - ZVAL_UNICODEL(z, u_str, l, 0); \ + ZVAL_UNICODEL(z, u_str, u_len, 0); \ } else { \ char *__s=(s); int __l=l; \ Z_STRLEN_P(z) = __l; \

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