#define DEBUG_ZEND 0
#define FREE_PNODE(znode) zval_dtor(&znode->u.constant);
-#define FREE_OP(Ts, op, should_free) if (should_free) zval_dtor(&Ts[(op)->u.var].tmp_var);
+#define FREE_OP(Ts, op, should_free) if (should_free) zval_dtor(should_free);
#define SET_UNUSED(op) (op).op_type = IS_UNUSED
#define RETURN_VALUE_USED(opline) (!((opline)->result.u.EA.type & EXT_TYPE_UNUSED))
-static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_free TSRMLS_DC)
+static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, zval **should_free TSRMLS_DC)
{
switch(node->op_type) {
case IS_CONST:
return &node->u.constant;
break;
case IS_TMP_VAR:
- *should_free = 1;
- return &Ts[node->u.var].tmp_var;
+ return *should_free = &Ts[node->u.var].tmp_var;
break;
case IS_VAR:
if (Ts[node->u.var].var.ptr) {
*should_free = 0;
return Ts[node->u.var].var.ptr;
} else {
- *should_free = 1;
+ *should_free = &Ts[node->u.var].tmp_var;
switch (Ts[node->u.var].EA.type) {
case IS_STRING_OFFSET: {
}
}
break;
- case IS_UNUSED:
- *should_free = 0;
- return NULL;
- break;
EMPTY_SWITCH_DEFAULT_CASE()
}
return NULL;
return get_zval_ptr_ptr(op, Ts, type);
}
-static inline zval *get_obj_zval_ptr(znode *op, temp_variable *Ts, int *freeop, int type TSRMLS_DC)
+static inline zval *get_obj_zval_ptr(znode *op, temp_variable *Ts, zval **freeop, int type TSRMLS_DC)
{
if(op->op_type == IS_UNUSED) {
if(EG(This)) {
static void zend_fetch_var_address(zend_op *opline, temp_variable *Ts, int type TSRMLS_DC)
{
- int free_op1;
+ zval *free_op1;
zval *varname = get_zval_ptr(&opline->op1, Ts, &free_op1, BP_VAR_R);
zval **retval;
zval tmp_varname;
static void zend_fetch_dimension_address_from_tmp_var(znode *result, znode *op1, znode *op2, temp_variable *Ts TSRMLS_DC)
{
- int free_op1;
+ zval *free_op1;
zval *container = get_zval_ptr(op1, Ts, &free_op1, BP_VAR_R);
if (container->type != IS_ARRAY) {
HashTable persistent_list;
zend_ptr_stack argument_stack;
- int free_op1, free_op2;
+ zval *free_op1, *free_op2;
int (*unary_op)(zval *result, zval *op1);
int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC);