diff options
| author | Nikita Popov <nikic@php.net> | 2016-09-28 23:05:21 +0200 |
|---|---|---|
| committer | Nikita Popov <nikic@php.net> | 2016-09-28 23:05:21 +0200 |
| commit | 40b8105cca1fa3cc4b696b059308b6d0f2827fa8 (patch) | |
| tree | fa50c8ff5d2548b8e71d9c52593b8e48f3d1c64d /Zend/zend_compile.c | |
| parent | 99bf19c177e272676c363565f5f7b7281a5f1acd (diff) | |
| download | php-git-40b8105cca1fa3cc4b696b059308b6d0f2827fa8.tar.gz | |
Fix the constant array case as well
Diffstat (limited to 'Zend/zend_compile.c')
| -rw-r--r-- | Zend/zend_compile.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 5b67ef8295..d3bec3714e 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5929,7 +5929,7 @@ void zend_do_add_array_element(znode *result, const znode *expr, const znode *of } /* }}} */ -void zend_do_add_static_array_element(zval *result, zval *offset, const zval *expr) /* {{{ */ +void zend_do_add_static_array_element(zval *result, zval *offset, zval *expr) /* {{{ */ { if (offset) { switch (Z_TYPE_P(offset)) { @@ -5952,7 +5952,10 @@ void zend_do_add_static_array_element(zval *result, zval *offset, const zval *ex break; } } else { - zend_hash_next_index_insert(Z_ARRVAL_P(result), &expr, sizeof(zval *), NULL); + if (zend_hash_next_index_insert(Z_ARRVAL_P(result), &expr, sizeof(zval *), NULL) == FAILURE) { + zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied"); + zval_ptr_dtor(&expr); + } } } /* }}} */ |
