summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_compile.c3
-rw-r--r--Zend/zend_execute.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index f666adeea7..48b7d9aea1 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1431,7 +1431,7 @@ void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
znode lval;
- if (fetch_type==ZEND_FETCH_STATIC) {
+ if (fetch_type==ZEND_FETCH_STATIC && static_assignment) {
zval *tmp = (zval *) emalloc(sizeof(zval));
convert_to_string(&varname->u.constant);
@@ -1459,6 +1459,7 @@ void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment
do_assign_ref(NULL, &lval, &opline->result CLS_CC);
+ CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
}
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 346b217fe0..8d6bbbbd91 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -379,6 +379,10 @@ static inline void zend_fetch_var_address(znode *result, znode *op1, znode *op2,
target_symbol_table = &EG(symbol_table);
break;
case ZEND_FETCH_STATIC:
+ if (!EG(active_op_array)->static_variables) {
+ EG(active_op_array)->static_variables = (HashTable *) emalloc(sizeof(HashTable));
+ zend_hash_init(EG(active_op_array)->static_variables, 2, NULL, PVAL_PTR_DTOR, 0);
+ }
target_symbol_table = EG(active_op_array)->static_variables;
break;
}