com php-src: restore the old behavior for the assignment to string offset: Zend/zend_execute.c

From: Date: Fri, 29 Aug 2014 15:28:53 +0000
Subject: com php-src: restore the old behavior for the assignment to string offset: Zend/zend_execute.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-81298@lists.php.net to get a copy of this message
Commit: d3fb1859f0db44c19b7766a8f6dda6b212ce9ce6 Author: Anatol Belski <ab@php.net> Fri, 29 Aug 2014 17:28:53 +0200 Parents: a9c5dab1d0a0fafa69a0d450849e95a899757a1d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d3fb1859f0db44c19b7766a8f6dda6b212ce9ce6 Log: restore the old behavior for the assignment to string offset Changed paths: M Zend/zend_execute.c Diff: diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 57e68a2...9237e97 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -762,11 +762,11 @@ static void zend_assign_to_string_offset(zval *str_offset, zval *value, int valu /* XXX String offset is uint32_t in _zval_struct, so can address only 2^32+1 space. To make the offset get over that barier, we need to make str_offset size_t and that would grow zval size by 8 bytes (currently from 16 to 24) on 64 bit build. */ - size_t offset = (size_t)Z_STR_OFFSET_IDX_P(str_offset); + uint32_t offset = Z_STR_OFFSET_IDX_P(str_offset); zend_string *old_str; - if ((zend_long)offset < 0) { - zend_error(E_WARNING, "Illegal string offset: %zd", offset); + if ((int)offset < 0) { + zend_error(E_WARNING, "Illegal string offset: %d", offset); zend_string_release(Z_STR_P(str)); if (result) { ZVAL_NULL(result); @@ -776,7 +776,7 @@ static void zend_assign_to_string_offset(zval *str_offset, zval *value, int valu old_str = Z_STR_P(str); if (offset >= Z_STRLEN_P(str)) { - size_t old_len = Z_STRLEN_P(str); + int old_len = Z_STRLEN_P(str); Z_STR_P(str) = zend_string_realloc(Z_STR_P(str), offset + 1, 0); Z_TYPE_INFO_P(str) = IS_STRING_EX; memset(Z_STRVAL_P(str) + old_len, ' ', offset - old_len);

« previous php.cvs (#81298) next »