From: Zeev Suraski Date: Mon, 3 Jan 2000 17:26:24 +0000 (+0000) Subject: Fix X-Git-Tag: BEFORE_PRE_SHUTDOWN_REVERSE_PATCH~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e99c415abf8ac6fd92c9629dac941bc7bdb579a;p=php Fix --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 1f4f56c757..6e78261129 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -534,28 +534,37 @@ static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, znode *op int free_op2; zval *dim = get_zval_ptr(op2, Ts, &free_op2, BP_VAR_R); zval **retval; + char *offset_key; + int offset_key_length; switch (dim->type) { - case IS_STRING: { - if (zend_hash_find(ht, dim->value.str.val, dim->value.str.len+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - zend_error(E_NOTICE,"Undefined index: %s", dim->value.str.val); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined index: %s", dim->value.str.val); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update_ptr(ht, dim->value.str.val, dim->value.str.len+1, new_zval, sizeof(zval *), (void **) &retval); - } - break; - } + case IS_UNSET: + offset_key = ""; + offset_key_length = 0; + goto fetch_string_dim; + case IS_STRING: + offset_key = dim->value.str.val; + offset_key_length = dim->value.str.len; + +fetch_string_dim: + if (zend_hash_find(ht, offset_key, offset_key_length+1, (void **) &retval) == FAILURE) { + switch (type) { + case BP_VAR_R: + zend_error(E_NOTICE,"Undefined index: %s", offset_key); + /* break missing intentionally */ + case BP_VAR_IS: + retval = &EG(uninitialized_zval_ptr); + break; + case BP_VAR_RW: + zend_error(E_NOTICE,"Undefined index: %s", offset_key); + /* break missing intentionally */ + case BP_VAR_W: { + zval *new_zval = &EG(uninitialized_zval); + + new_zval->refcount++; + zend_hash_update_ptr(ht, offset_key, offset_key_length+1, new_zval, sizeof(zval *), (void **) &retval); + } + break; } } break;