]> granicus.if.org Git - php/commitdiff
Fixed patch for bug #31478 (SegFault/Memory Leak with empty())
authorDmitry Stogov <dmitry@php.net>
Tue, 18 Jan 2005 12:01:31 +0000 (12:01 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 18 Jan 2005 12:01:31 +0000 (12:01 +0000)
Zend/zend_compile.c

index cad9f26fcda1b9032b6fe89d3eae0385b6600684..466748b052b3c6afc50fac134b4308dfa23466a9 100644 (file)
@@ -3305,6 +3305,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
                last_op->op1.u.constant.value.str.val = estrdup(CG(active_op_array)->vars[variable->u.var].name);
                SET_UNUSED(last_op->op2);
                last_op->op2.u.EA.type = ZEND_FETCH_LOCAL;
+               last_op->result.u.var = get_temporary_variable(CG(active_op_array));
        } else {
                last_op = &CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1];
        
@@ -3321,7 +3322,6 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
                }
        }
        last_op->result.op_type = IS_TMP_VAR;
-       last_op->result.u.var = get_temporary_variable(CG(active_op_array));
        last_op->extended_value = type;
 
        *result = last_op->result;