com php-src: Merge branch 'master' into str_size_and_int 64: Zend/zend_builtin_functions.c Zend/zend_e xecute_API.c Zend/zend_hash.c ext/gmp/gmp.c ext
/pcre/php_pcre.c
| From: | Anatol Belski | Date: | Fri, 29 Nov 2013 16:00:11 +0000 |
| Subject: | com php-src: Merge branch 'master' into str_size_and_int 64: Zend/zend_builtin_functions.c Zend/zend_e xecute_API.c Zend/zend_hash.c ext/gmp/gmp.c ext /pcre/php_pcre.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74166@lists.php.net to get a copy of this message | ||
Commit: 40f9958c085a85beeb31014cf58e690c4713e166
Author: Anatol Belski <ab@php.net> Fri, 29 Nov 2013 17:00:11 +0100
Parents: eabdd0e4a5fdfa77ad9dd5f7b9e1387106fc31ff f65e652f9fa25fa9b30a6f79078cc7459bd43723
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=40f9958c085a85beeb31014cf58e690c4713e166
Log:
Merge branch 'master' into str_size_and_int64
Conflicts:
Zend/zend_hash.c
ext/gmp/gmp.c
ext/pcre/php_pcre.c
Changed paths:
MM Zend/zend_builtin_functions.c
MM Zend/zend_execute_API.c
MM Zend/zend_hash.c
MM ext/gmp/gmp.c
MM ext/pcre/php_pcre.c
Diff:
diff --cc Zend/zend_builtin_functions.c
index b457587,91bca37..603e622
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@@ -1017,10 -1017,17 +1017,17 @@@ ZEND_FUNCTION(get_object_vars
while (zend_hash_get_current_data_ex(properties, (void **) &value, &pos) == SUCCESS) {
if (zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0,
&pos) == HASH_KEY_IS_STRING) {
if (zend_check_property_access(zobj, key, key_len-1 TSRMLS_CC) == SUCCESS) {
- zend_unmangle_property_name_ex(key, key_len - 1, &class_name, &prop_name, (int*)
&prop_len);
+ zend_unmangle_property_name_ex(key, key_len - 1, &class_name, &prop_name,
&prop_len);
/* Not separating references */
Z_ADDREF_PP(value);
- add_assoc_zval_ex(return_value, prop_name, prop_len + 1, *value);
+ if (IS_INTERNED(key) && prop_name != key) {
+ /* we can't use substring of interned string as a new key */
+ char *tmp = estrndup(prop_name, prop_len);
+ add_assoc_zval_ex(return_value, tmp, prop_len + 1, *value);
+ efree(tmp);
+ } else {
+ add_assoc_zval_ex(return_value, prop_name, prop_len + 1, *value);
+ }
}
}
zend_hash_move_forward_ex(properties, &pos);
diff --cc Zend/zend_hash.c
index 53fdfd3,e938d1d..4b12241
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@@ -1123,8 -1123,8 +1123,8 @@@ ZEND_API void zend_hash_get_current_key
Z_TYPE_P(key) = IS_NULL;
} else if (p->nKeyLength) {
Z_TYPE_P(key) = IS_STRING;
- Z_STRVAL_P(key) = estrndup(p->arKey, p->nKeyLength - 1);
+ Z_STRVAL_P(key) = IS_INTERNED(p->arKey) ? (char*)p->arKey : estrndup(p->arKey,
p->nKeyLength - 1);
- Z_STRLEN_P(key) = p->nKeyLength - 1;
+ Z_STRSIZE_P(key) = p->nKeyLength - 1;
} else {
Z_TYPE_P(key) = IS_LONG;
Z_LVAL_P(key) = p->h;
diff --cc ext/pcre/php_pcre.c
index 75454cf,1e88291..3daa8e8
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@@ -1358,11 -1339,12 +1358,12 @@@ static void preg_replace_impl(INTERNAL_
**subject_entry,
**zcount = NULL;
char *result;
- int result_len;
+ zend_str_size_int result_len;
int limit_val = -1;
- long limit = -1;
+ php_int_t limit = -1;
char *string_key;
- zend_uint_t num_key;
- uint string_key_len;
- ulong num_key;
++ zend_str_size_uint string_key_len;
++ php_uint_t num_key;
char *callback_name;
int replace_count=0, old_replace_count;
@@@ -1798,7 -1771,8 +1799,8 @@@ PHPAPI void php_pcre_grep_impl(pcre_ca
int size_offsets; /* Size of the offsets array */
int count = 0; /* Count of matched subpatterns */
char *string_key;
- zend_uint_t num_key;
- uint string_key_len;
- ulong num_key;
++ zend_str_size_uint string_key_len;
++ php_uint_t num_key;
zend_bool invert; /* Whether to return non-matching
entries */
int rc;