summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-29 17:28:53 +0200
committerAnatol Belski <ab@php.net>2014-08-29 17:28:53 +0200
commitd3fb1859f0db44c19b7766a8f6dda6b212ce9ce6 (patch)
tree8d1e391759a8a12545deeec353f513ccd89ff387
parenta9c5dab1d0a0fafa69a0d450849e95a899757a1d (diff)
downloadphp-git-d3fb1859f0db44c19b7766a8f6dda6b212ce9ce6.tar.gz
restore the old behavior for the assignment to string offset
-rw-r--r--Zend/zend_execute.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 57e68a2d53..9237e97415 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);