]> granicus.if.org Git - php/commitdiff
The previous fix ended up being broken, this one should do it
authorZeev Suraski <zeev@php.net>
Fri, 31 Mar 2000 15:17:43 +0000 (15:17 +0000)
committerZeev Suraski <zeev@php.net>
Fri, 31 Mar 2000 15:17:43 +0000 (15:17 +0000)
Zend/zend_compile.c

index f09f7293d0f15b54434aaaf4e17c545080c44460..d57cb6275d1835f00a98d666eeac0b116cae73af 100644 (file)
@@ -1844,9 +1844,9 @@ void do_list_end(znode *result, znode *expr CLS_DC)
 
 void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC)
 {
-       int opline_num = get_next_op_number(CG(active_op_array));
        zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
        znode lval;
+       znode result;
 
        if (fetch_type==ZEND_FETCH_STATIC && static_assignment) {
                zval *tmp;
@@ -1869,13 +1869,14 @@ void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment
        opline->op1 = *varname;
        SET_UNUSED(opline->op2);
        opline->op2.u.fetch_type = fetch_type;
+       result = opline->result;
 
        if (varname->op_type == IS_CONST) {
                zval_copy_ctor(&varname->u.constant);
        }
        fetch_simple_variable(&lval, varname, 0 CLS_CC); /* Relies on the fact that the default fetch is BP_VAR_W */
 
-       do_assign_ref(NULL, &lval, &CG(active_op_array)->opcodes[opline_num].result CLS_CC);
+       do_assign_ref(NULL, &lval, &result CLS_CC);
        CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
 }