mattwil Thu Jun 4 18:18:47 2009 UTC Modified files: /php-src README.PARAMETER_PARSING_API /ZendEngine2 Zend.m4 zend_API.c zend_compile.c zend_execute.c zend_execute_API.c zend_operators.c zend_operators.h zend_vm_def.h zend_vm_execute.h /php-src/win32/build config.w32 Log: Restored double->long conversion behavior to that of PHP 5.2 (on most platforms) and prior: * Out-of-range numbers overflow/preserve least significant bits (no LONG_MAX/MIN limit) * See bug #42868 (presumably-rare platform with different results in 5.2) * On 32-bit platforms with 64-bit long type, a zend_long64 cast has been added, otherwise it's the same as 5.2 * Use this conversion method everywhere instead of some plain (long) casts Added 'L' parameter parsing specifier to ensure a LONG_MAX/MIN limit: * Essentially what 5.3's new conversion was doing in most cases * Functions with "limit" or "length" type params could be updated to use this, and prevent confusing overflow behavior with huge numbers (*also* in 5.2) - See bug #47854, for example; or even #42868 again # Test updates coming
http://cvs.php.net/viewvc.cgi/php-src/README.PARAMETER_PARSING_API?r1=1.26&r2=1.27&diff_format=u Index: php-src/README.PARAMETER_PARSING_API diff -u php-src/README.PARAMETER_PARSING_API:1.26 php-src/README.PARAMETER_PARSING_API:1.27 --- php-src/README.PARAMETER_PARSING_API:1.26 Mon Nov 24 19:18:34 2008 +++ php-src/README.PARAMETER_PARSING_API Thu Jun 4 18:18:46 2009 @@ -48,6 +48,7 @@ h - array (returned as HashTable*) H - array or HASH_OF(object) (returned as HashTable*) l - long (long) + L - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (long) o - object of any type (zval*) O - object of specific type given by class entry (zval*, zend_class_entry) r - resource (zval*) http://cvs.php.net/viewvc.cgi/ZendEngine2/Zend.m4?r1=1.69&r2=1.70&diff_format=u Index: ZendEngine2/Zend.m4 diff -u ZendEngine2/Zend.m4:1.69 ZendEngine2/Zend.m4:1.70 --- ZendEngine2/Zend.m4:1.69 Tue May 19 11:40:05 2009 +++ ZendEngine2/Zend.m4 Thu Jun 4 18:18:46 2009 @@ -1,5 +1,5 @@ dnl -dnl $Id: Zend.m4,v 1.69 2009/05/19 11:40:05 lbarnaud Exp $ +dnl $Id: Zend.m4,v 1.70 2009/06/04 18:18:46 mattwil Exp $ dnl dnl This file contains Zend specific autoconf functions. dnl @@ -117,6 +117,38 @@ ZEND_FP_EXCEPT ZEND_CHECK_FLOAT_PRECISION + +dnl test whether double cast to long preserves least significant bits +AC_MSG_CHECKING(whether double cast to long preserves least significant bits) + +AC_TRY_RUN([ +#include <limits.h> + +int main() +{ + if (sizeof(long) == 4) { + double d = (double) LONG_MIN * LONG_MIN + 2e9; + + if ((long) d == 2e9 && (long) -d == -2e9) { + exit(0); + } + } else if (sizeof(long) == 8) { + double correct = 18e18 - ((double) LONG_MIN * -2); /* Subtract ULONG_MAX + 1 */ + + if ((long) 18e18 == correct) { /* On 64-bit, only check between LONG_MAX and ULONG_MAX */ + exit(0); + } + } + exit(1); +} +], [ + AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits]) + AC_MSG_RESULT(yes) +], [ + AC_MSG_RESULT(no) +], [ + AC_MSG_RESULT(no) +]) ]) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.502&r2=1.503&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.502 ZendEngine2/zend_API.c:1.503 --- ZendEngine2/zend_API.c:1.502 Mon May 25 14:32:13 2009 +++ ZendEngine2/zend_API.c Thu Jun 4 18:18:46 2009 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.502 2009/05/25 14:32:13 felipe Exp $ */ +/* $Id: zend_API.c,v 1.503 2009/06/04 18:18:46 mattwil Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -343,6 +343,7 @@ switch (c) { case 'l': + case 'L': { long *p = va_arg(*va, long *); switch (Z_TYPE_PP(arg)) { @@ -354,7 +355,17 @@ if ((type = is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), p, &d, -1)) == 0) { return "long"; } else if (type == IS_DOUBLE) { - *p = (long) d; + if (c == 'L') { + if (d > LONG_MAX) { + *p = LONG_MAX; + break; + } else if (d < LONG_MIN) { + *p = LONG_MIN; + break; + } + } + + *p = zend_dval_to_lval(d); } } break; @@ -367,14 +378,33 @@ if ((type = is_numeric_unicode(Z_USTRVAL_PP(arg), Z_USTRLEN_PP(arg), p, &d, -1)) == 0) { return "long"; } else if (type == IS_DOUBLE) { - *p = (long) d; + if (c == 'L') { + if (d > LONG_MAX) { + *p = LONG_MAX; + break; + } else if (d < LONG_MIN) { + *p = LONG_MIN; + break; + } + } + + *p = zend_dval_to_lval(d); } } break; + case IS_DOUBLE: + if (c == 'L') { + if (Z_DVAL_PP(arg) > LONG_MAX) { + *p = LONG_MAX; + break; + } else if (Z_DVAL_PP(arg) < LONG_MIN) { + *p = LONG_MIN; + break; + } + } case IS_NULL: case IS_LONG: - case IS_DOUBLE: case IS_BOOL: convert_to_long_ex(arg); *p = Z_LVAL_PP(arg); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.859&r2=1.860&diff_format=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.859 ZendEngine2/zend_compile.c:1.860 --- ZendEngine2/zend_compile.c:1.859 Wed May 27 11:58:44 2009 +++ ZendEngine2/zend_compile.c Thu Jun 4 18:18:46 2009 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.859 2009/05/27 11:58:44 dsp Exp $ */ +/* $Id: zend_compile.c,v 1.860 2009/06/04 18:18:46 mattwil Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -4209,7 +4209,6 @@ ALLOC_ZVAL(element); *element = expr->u.constant; if (offset) { - long l; zend_uchar utype = Z_TYPE(offset->u.constant); switch (Z_TYPE(offset->u.constant) & IS_CONSTANT_TYPE_MASK) { @@ -4237,8 +4236,7 @@ zend_hash_index_update(Z_ARRVAL(result->u.constant), Z_LVAL(offset->u.constant), &element, sizeof(zval *), NULL); break; case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL(offset->u.constant), l); - zend_hash_index_update(Z_ARRVAL(result->u.constant), l, &element, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL(result->u.constant), zend_dval_to_lval(Z_DVAL(offset->u.constant)), &element, sizeof(zval *), NULL); break; case IS_CONSTANT_ARRAY: zend_error(E_ERROR, "Illegal offset type"); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute.c?r1=1.813&r2=1.814&diff_format=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.813 ZendEngine2/zend_execute.c:1.814 --- ZendEngine2/zend_execute.c:1.813 Tue Apr 21 09:40:33 2009 +++ ZendEngine2/zend_execute.c Thu Jun 4 18:18:46 2009 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.813 2009/04/21 09:40:33 dmitry Exp $ */ +/* $Id: zend_execute.c,v 1.814 2009/06/04 18:18:46 mattwil Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -925,10 +925,9 @@ efree(offset_key.v); } break; - case IS_DOUBLE: { - DVAL_TO_LVAL(Z_DVAL_P(dim), index); + case IS_DOUBLE: + index = zend_dval_to_lval(Z_DVAL_P(dim)); goto num_index; - } case IS_RESOURCE: zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(dim), Z_LVAL_P(dim)); /* Fall Through */ http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.478&r2=1.479&diff_format=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.478 ZendEngine2/zend_execute_API.c:1.479 --- ZendEngine2/zend_execute_API.c:1.478 Mon May 25 14:32:13 2009 +++ ZendEngine2/zend_execute_API.c Thu Jun 4 18:18:46 2009 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.478 2009/05/25 14:32:13 felipe Exp $ */ +/* $Id: zend_execute_API.c,v 1.479 2009/06/04 18:18:46 mattwil Exp $ */ #include <stdio.h> #include <signal.h> @@ -698,7 +698,7 @@ ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL_ZSTR, 0, Z_LVAL(const_value), HASH_UPDATE_KEY_IF_BEFORE, NULL); break; case IS_DOUBLE: - ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL_ZSTR, 0, (long)Z_DVAL(const_value), HASH_UPDATE_KEY_IF_BEFORE, NULL); + ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL_ZSTR, 0, zend_dval_to_lval(Z_DVAL(const_value)), HASH_UPDATE_KEY_IF_BEFORE, NULL); break; case IS_NULL: ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_STRING, EMPTY_ZSTR, 1, 0, HASH_UPDATE_KEY_IF_BEFORE, NULL); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.c?r1=1.308&r2=1.309&diff_format=u Index: ZendEngine2/zend_operators.c diff -u ZendEngine2/zend_operators.c:1.308 ZendEngine2/zend_operators.c:1.309 --- ZendEngine2/zend_operators.c:1.308 Mon May 11 08:31:03 2009 +++ ZendEngine2/zend_operators.c Thu Jun 4 18:18:46 2009 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_operators.c,v 1.308 2009/05/11 08:31:03 jani Exp $ */ +/* $Id: zend_operators.c,v 1.309 2009/06/04 18:18:46 mattwil Exp $ */ #include <ctype.h> @@ -274,7 +274,7 @@ Z_LVAL(holder) = 0; \ break; \ case IS_DOUBLE: \ - DVAL_TO_LVAL(Z_DVAL_P(op), Z_LVAL(holder)); \ + Z_LVAL(holder) = zend_dval_to_lval(Z_DVAL_P(op)); \ break; \ case IS_STRING: \ Z_LVAL(holder) = strtol(Z_STRVAL_P(op), NULL, 10); \ @@ -409,7 +409,7 @@ case IS_LONG: break; case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(op), Z_LVAL_P(op)); + Z_LVAL_P(op) = zend_dval_to_lval(Z_DVAL_P(op)); break; case IS_STRING: { @@ -1467,7 +1467,7 @@ ZVAL_LONG(result, ~Z_LVAL_P(op1)); return SUCCESS; } else if (Z_TYPE_P(op1) == IS_DOUBLE) { - ZVAL_LONG(result, ~(long) Z_DVAL_P(op1)); + ZVAL_LONG(result, ~zend_dval_to_lval(Z_DVAL_P(op1))); return SUCCESS; } else if (Z_TYPE_P(op1) == IS_STRING) { int i; http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.h?r1=1.140&r2=1.141&diff_format=u Index: ZendEngine2/zend_operators.h diff -u ZendEngine2/zend_operators.h:1.140 ZendEngine2/zend_operators.h:1.141 --- ZendEngine2/zend_operators.h:1.140 Mon May 25 14:32:13 2009 +++ ZendEngine2/zend_operators.h Thu Jun 4 18:18:46 2009 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_operators.h,v 1.140 2009/05/25 14:32:13 felipe Exp $ */ +/* $Id: zend_operators.h,v 1.141 2009/06/04 18:18:46 mattwil Exp $ */ #ifndef ZEND_OPERATORS_H #define ZEND_OPERATORS_H @@ -66,39 +66,25 @@ ZEND_API double zend_u_strtod(const UChar *nptr, UChar **endptr); END_EXTERN_C() -/* {{{ DVAL_TO_LVAL */ -#define MAX_UNSIGNED_INT ((double) LONG_MAX * 2) + 1 -#ifdef _WIN64 -# define DVAL_TO_LVAL(d, l) \ - if ((d) > LONG_MAX) { \ - (l) = (long)(unsigned long)(__int64) (d); \ - } else { \ - (l) = (long) (d); \ - } -#elif !defined(_WIN64) && __WORDSIZE == 64 -# define DVAL_TO_LVAL(d, l) \ - if ((d) >= LONG_MAX) { \ - (l) = LONG_MAX; \ - } else if ((d) <= LONG_MIN) { \ - (l) = LONG_MIN; \ - } else { \ - (l) = (long) (d); \ +/* {{{ zend_dval_to_lval */ +#if ZEND_DVAL_TO_LVAL_CAST_OK +# define zend_dval_to_lval(d) ((long) (d)) +#elif SIZEOF_LONG == 4 && defined(HAVE_ZEND_LONG64) +static zend_always_inline long zend_dval_to_lval(double d) +{ + if (d > LONG_MAX || d < LONG_MIN) { + return (long)(unsigned long)(zend_long64) d; } + return (long) d; +} #else -# define DVAL_TO_LVAL(d, l) \ - if ((d) > LONG_MAX) { \ - if ((d) > MAX_UNSIGNED_INT) { \ - (l) = LONG_MAX; \ - } else { \ - (l) = (unsigned long) (d); \ - } \ - } else { \ - if((d) < LONG_MIN) { \ - (l) = LONG_MIN; \ - } else { \ - (l) = (long) (d); \ - } \ +static zend_always_inline long zend_dval_to_lval(double d) +{ + if (d > LONG_MAX) { + return (long)(unsigned long) d; } + return (long) d; +} #endif /* }}} */ http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.266&r2=1.267&diff_format=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.266 ZendEngine2/zend_vm_def.h:1.267 --- ZendEngine2/zend_vm_def.h:1.266 Mon Jun 1 15:07:27 2009 +++ ZendEngine2/zend_vm_def.h Thu Jun 4 18:18:46 2009 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_def.h,v 1.266 2009/06/01 15:07:27 lbarnaud Exp $ */ +/* $Id: zend_vm_def.h,v 1.267 2009/06/04 18:18:46 mattwil Exp $ */ /* If you change this file, please regenerate the zend_vm_execute.h and * zend_vm_opcodes.h files by running: @@ -3169,11 +3169,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -3537,7 +3535,6 @@ zend_free_op free_op1, free_op2; zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET); zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - long index; if (OP1_TYPE != IS_VAR || container) { if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -3549,14 +3546,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -4071,7 +4066,6 @@ zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_IS); zval **value = NULL; int result = 0; - long index; if (OP1_TYPE != IS_VAR || container) { zend_free_op free_op2; @@ -4085,16 +4079,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.270&r2=1.271&diff_format=u Index: ZendEngine2/zend_vm_execute.h diff -u ZendEngine2/zend_vm_execute.h:1.270 ZendEngine2/zend_vm_execute.h:1.271 --- ZendEngine2/zend_vm_execute.h:1.270 Mon Jun 1 15:07:27 2009 +++ ZendEngine2/zend_vm_execute.h Thu Jun 4 18:18:46 2009 @@ -2933,11 +2933,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -3458,11 +3456,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -3930,11 +3926,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -4126,11 +4120,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -4597,11 +4589,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -6308,11 +6298,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -6783,11 +6771,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -7258,11 +7244,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -7354,11 +7338,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -7826,11 +7808,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -11037,11 +11017,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -11092,7 +11070,6 @@ zend_free_op free_op1; zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); zval *offset = &opline->op2.u.constant; - long index; if (IS_VAR != IS_VAR || container) { if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -11104,14 +11081,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -11248,7 +11223,6 @@ zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); zval **value = NULL; int result = 0; - long index; if (IS_VAR != IS_VAR || container) { @@ -11262,16 +11236,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -12863,11 +12835,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -12918,7 +12888,6 @@ zend_free_op free_op1, free_op2; zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; if (IS_VAR != IS_VAR || container) { if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -12930,14 +12899,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -13074,7 +13041,6 @@ zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); zval **value = NULL; int result = 0; - long index; if (IS_VAR != IS_VAR || container) { zend_free_op free_op2; @@ -13088,16 +13054,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -14740,11 +14704,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -14795,7 +14757,6 @@ zend_free_op free_op1, free_op2; zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; if (IS_VAR != IS_VAR || container) { if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -14807,14 +14768,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -14951,7 +14910,6 @@ zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); zval **value = NULL; int result = 0; - long index; if (IS_VAR != IS_VAR || container) { zend_free_op free_op2; @@ -14965,16 +14923,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -15670,11 +15626,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -17212,11 +17166,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -17267,7 +17219,6 @@ zend_free_op free_op1; zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - long index; if (IS_VAR != IS_VAR || container) { if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -17279,14 +17230,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -17423,7 +17372,6 @@ zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); zval **value = NULL; int result = 0; - long index; if (IS_VAR != IS_VAR || container) { @@ -17437,16 +17385,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -18531,7 +18477,6 @@ zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval *offset = &opline->op2.u.constant; - long index; if (IS_UNUSED != IS_VAR || container) { if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -18543,14 +18488,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -18685,7 +18628,6 @@ zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval **value = NULL; int result = 0; - long index; if (IS_UNUSED != IS_VAR || container) { @@ -18699,16 +18641,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -19652,7 +19592,6 @@ zend_free_op free_op2; zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; if (IS_UNUSED != IS_VAR || container) { if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -19664,14 +19603,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -19806,7 +19743,6 @@ zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval **value = NULL; int result = 0; - long index; if (IS_UNUSED != IS_VAR || container) { zend_free_op free_op2; @@ -19820,16 +19756,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -20773,7 +20707,6 @@ zend_free_op free_op2; zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; if (IS_UNUSED != IS_VAR || container) { if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -20785,14 +20718,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -20927,7 +20858,6 @@ zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval **value = NULL; int result = 0; - long index; if (IS_UNUSED != IS_VAR || container) { zend_free_op free_op2; @@ -20941,16 +20871,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -22152,7 +22080,6 @@ zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - long index; if (IS_UNUSED != IS_VAR || container) { if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -22164,14 +22091,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -22306,7 +22231,6 @@ zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval **value = NULL; int result = 0; - long index; if (IS_UNUSED != IS_VAR || container) { @@ -22320,16 +22244,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -25283,11 +25205,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -25338,7 +25258,6 @@ zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); zval *offset = &opline->op2.u.constant; - long index; if (IS_CV != IS_VAR || container) { if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -25350,14 +25269,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -25492,7 +25409,6 @@ zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); zval **value = NULL; int result = 0; - long index; if (IS_CV != IS_VAR || container) { @@ -25506,16 +25422,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -26997,11 +26911,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -27052,7 +26964,6 @@ zend_free_op free_op2; zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; if (IS_CV != IS_VAR || container) { if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -27064,14 +26975,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -27206,7 +27115,6 @@ zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); zval **value = NULL; int result = 0; - long index; if (IS_CV != IS_VAR || container) { zend_free_op free_op2; @@ -27220,16 +27128,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -28761,11 +28667,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -28816,7 +28720,6 @@ zend_free_op free_op2; zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; if (IS_CV != IS_VAR || container) { if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -28828,14 +28731,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -28970,7 +28871,6 @@ zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); zval **value = NULL; int result = 0; - long index; if (IS_CV != IS_VAR || container) { zend_free_op free_op2; @@ -28984,16 +28884,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; @@ -29585,11 +29483,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -31018,11 +30914,9 @@ } } if (offset) { - long l; switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - DVAL_TO_LVAL(Z_DVAL_P(offset), l); - zend_hash_index_update(Z_ARRVAL_P(array_ptr), l, &expr_ptr, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL); break; case IS_LONG: case IS_BOOL: @@ -31073,7 +30967,6 @@ zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - long index; if (IS_CV != IS_VAR || container) { if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -31085,14 +30978,12 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset))); break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); + zend_hash_index_del(ht, Z_LVAL_P(offset)); break; case IS_STRING: case IS_UNICODE: { @@ -31227,7 +31118,6 @@ zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); zval **value = NULL; int result = 0; - long index; if (IS_CV != IS_VAR || container) { @@ -31241,16 +31131,14 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) { isset = 1; } break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { + if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) { isset = 1; } break; http://cvs.php.net/viewvc.cgi/php-src/win32/build/config.w32?r1=1.103&r2=1.104&diff_format=u Index: php-src/win32/build/config.w32 diff -u php-src/win32/build/config.w32:1.103 php-src/win32/build/config.w32:1.104 --- php-src/win32/build/config.w32:1.103 Fri Apr 24 15:19:10 2009 +++ php-src/win32/build/config.w32 Thu Jun 4 18:18:47 2009 @@ -1,5 +1,5 @@ // vim:ft=javascript -// $Id: config.w32,v 1.103 2009/04/24 15:19:10 pajoye Exp $ +// $Id: config.w32,v 1.104 2009/06/04 18:18:47 mattwil Exp $ // "Master" config file; think of it as a configure.in // equivalent. @@ -355,6 +355,10 @@ zend_default_classes.c zend_execute.c zend_strtod.c zend_gc.c zend_closures.c \ zend_float.c"); +if (VCVERS == 1200) { + AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1); +} + ADD_SOURCES("main", "main.c snprintf.c spprintf.c fopen_wrappers.c \ php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \ strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c network.c \
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php