diff options
Diffstat (limited to 'ext/opcache/zend_accelerator_util_funcs.c')
-rw-r--r-- | ext/opcache/zend_accelerator_util_funcs.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index ab048c6df3..f9bb6a11cc 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -230,6 +230,7 @@ static void zend_hash_clone_constants(HashTable *ht, HashTable *source) { Bucket *p, *q, *end; zend_ulong nIndex; + zend_class_constant *c; ht->nTableSize = source->nTableSize; ht->nTableMask = source->nTableMask; @@ -265,8 +266,14 @@ static void zend_hash_clone_constants(HashTable *ht, HashTable *source) q->key = p->key; /* Copy data */ - ZVAL_COPY_VALUE(&q->val, &p->val); - zend_clone_zval(&q->val); + c = ARENA_REALLOC(Z_PTR(p->val)); + ZVAL_PTR(&q->val, c); + + zend_clone_zval(&c->value); + if ((void*)c->ce >= ZCG(current_persistent_script)->arena_mem && + (void*)c->ce < (void*)((char*)ZCG(current_persistent_script)->arena_mem + ZCG(current_persistent_script)->arena_size)) { + c->ce = ARENA_REALLOC(c->ce); + } } } |