summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-02-20 13:28:26 +0300
committerDmitry Stogov <dmitry@zend.com>2015-02-20 13:28:26 +0300
commitd85113702cc6030a9149f518c55953ccb6933a7c (patch)
treed203e105d433a87050fca191298d1757d4aeeaba /Zend/zend_execute.c
parent582aa41d6fb7bf803b5d731ec9f5d6627d01c4c7 (diff)
downloadphp-git-d85113702cc6030a9149f518c55953ccb6933a7c.tar.gz
Lazy duplication of op_array->static_variables
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 539b1e4dd7..00a68613fc 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1166,6 +1166,12 @@ static zend_always_inline HashTable *zend_get_target_symbol_table(zend_execute_d
} else if (EXPECTED(fetch_type == ZEND_FETCH_STATIC)) {
ZEND_ASSERT(EX(func)->op_array.static_variables != NULL);
ht = EX(func)->op_array.static_variables;
+ if (GC_REFCOUNT(ht) > 1) {
+ if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE)) {
+ GC_REFCOUNT(ht)--;
+ }
+ EX(func)->op_array.static_variables = ht = zend_array_dup(ht);
+ }
} else {
ZEND_ASSERT(fetch_type == ZEND_FETCH_LOCAL);
if (!EX(symbol_table)) {