diff options
-rw-r--r-- | Zend/zend_vm_def.h | 10 | ||||
-rw-r--r-- | Zend/zend_vm_execute.h | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index bff84db922..bec9169e8d 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -5387,6 +5387,16 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST) c.value = *tmp_ptr; } else { INIT_PZVAL_COPY(&c.value, val); + if (Z_TYPE(c.value) == IS_ARRAY) { + HashTable *ht; + + ALLOC_HASHTABLE(ht); + zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL(c.value)), NULL, ZVAL_PTR_DTOR, 0); + zend_hash_copy(ht, Z_ARRVAL(c.value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *)); + Z_ARRVAL(c.value) = ht; + } else { + zval_copy_ctor(&c.value); + } zval_copy_ctor(&c.value); } c.flags = CONST_CS; /* non persistent, case sensetive */ diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 0151ea0684..7e6cfb3e27 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4323,6 +4323,16 @@ static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCOD c.value = *tmp_ptr; } else { INIT_PZVAL_COPY(&c.value, val); + if (Z_TYPE(c.value) == IS_ARRAY) { + HashTable *ht; + + ALLOC_HASHTABLE(ht); + zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL(c.value)), NULL, ZVAL_PTR_DTOR, 0); + zend_hash_copy(ht, Z_ARRVAL(c.value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *)); + Z_ARRVAL(c.value) = ht; + } else { + zval_copy_ctor(&c.value); + } zval_copy_ctor(&c.value); } c.flags = CONST_CS; /* non persistent, case sensetive */ |