diff options
| author | Anatol Belski <ab@php.net> | 2014-12-06 21:37:15 +0100 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2014-12-06 21:37:15 +0100 |
| commit | ba35b22bc4a7af791ff2ab7c2ca8e9f4aa6d64df (patch) | |
| tree | 92d7a7d9dd424b53e50a194af06ec3cfb514633e /Zend/zend_execute.c | |
| parent | 88bb9fedc4b5fc750524a7b00be1d46fde2f5929 (diff) | |
| parent | aa52fcf179d9e233075e4d213d5708cc5b5e1ae2 (diff) | |
| download | php-git-ba35b22bc4a7af791ff2ab7c2ca8e9f4aa6d64df.tar.gz | |
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (35 commits)
Fixed bug #68398 msooxml matches too many archives
Fix zpp call in apache_getenv()
Drop unnecessary zval containers
fixed test
C89 compat
add include for missing localeconv_r proto
updated NEWS
Fixed bug #65230 setting locale randomly broken
Fix compilation error (ref #68424)
Removed useless handlers
Move checks for references into slow paths of operator functions. Remove duplicate opcode handlers.
Revert unintentional docblock change
Restored zip/oci8 PHP 4 code, add PHP 7 checks
Note macro removal in UPGRADING.INTERNALS
Removed ZEND_ENGINE_2 checks (and ZE1 code, it's been a decade!)
Zend Engine 3
Updated NEWS
Updated NEWS
Updated NEWS
Start adding new attribute to control multi statements
...
Diffstat (limited to 'Zend/zend_execute.c')
| -rw-r--r-- | Zend/zend_execute.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index a9fadd10da..b5ad563590 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1014,6 +1014,7 @@ static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht zend_string *offset_key; zend_ulong hval; +try_again: if (EXPECTED(Z_TYPE_P(dim) == IS_LONG)) { hval = Z_LVAL_P(dim); num_index: @@ -1101,6 +1102,9 @@ str_index: case IS_TRUE: hval = 1; goto num_index; + case IS_REFERENCE: + dim = Z_REFVAL_P(dim); + goto try_again; default: zend_error(E_WARNING, "Illegal offset type"); retval = (type == BP_VAR_W || type == BP_VAR_RW) ? @@ -1118,6 +1122,7 @@ static zend_never_inline zend_long zend_check_string_offset(zval *container, zva zend_error_noreturn(E_ERROR, "[] operator not supported for strings"); } +try_again: if (UNEXPECTED(Z_TYPE_P(dim) != IS_LONG)) { switch(Z_TYPE_P(dim)) { case IS_STRING: @@ -1134,6 +1139,9 @@ static zend_never_inline zend_long zend_check_string_offset(zval *container, zva case IS_TRUE: zend_error(E_NOTICE, "String offset cast occurred"); break; + case IS_REFERENCE: + dim = Z_REFVAL_P(dim); + goto try_again; default: zend_error(E_WARNING, "Illegal offset type"); break; @@ -1269,13 +1277,13 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z { zval *retval; - ZVAL_DEREF(container); if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type TSRMLS_CC); ZVAL_COPY(result, retval); } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_long offset; +try_again: if (UNEXPECTED(Z_TYPE_P(dim) != IS_LONG)) { switch(Z_TYPE_P(dim)) { /* case IS_LONG: */ @@ -1295,6 +1303,9 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z zend_error(E_NOTICE, "String offset cast occurred"); } break; + case IS_REFERENCE: + dim = Z_REFVAL_P(dim); + goto try_again; default: zend_error(E_WARNING, "Illegal offset type"); break; |
