From: Dmitry Stogov Date: Fri, 24 Jun 2005 09:25:02 +0000 (+0000) Subject: Partial fix for bug #26584 (Class member - array key overflow) X-Git-Tag: php-5.0.5RC1~128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a029c98992a8e6c807c5d4055f63eb26c53a5c04;p=php Partial fix for bug #26584 (Class member - array key overflow) It doesn't fix integer overflow problem, but allows null, boolean and double keys in array constants in the same way as in runtime. --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 3e372a1bbc..f0da66afad 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3027,9 +3027,16 @@ void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr) zend_symtable_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL); zval_dtor(&offset->u.constant); break; + case IS_NULL: + zend_symtable_update(result->u.constant.value.ht, "", 1, &element, sizeof(zval *), NULL); + break; case IS_LONG: + case IS_BOOL: zend_hash_index_update(result->u.constant.value.ht, offset->u.constant.value.lval, &element, sizeof(zval *), NULL); break; + case IS_DOUBLE: + zend_hash_index_update(result->u.constant.value.ht, (long)offset->u.constant.value.dval, &element, sizeof(zval *), NULL); + break; } } else { zend_hash_next_index_insert(result->u.constant.value.ht, &element, sizeof(zval *), NULL);