}
/* }}} */
-static void zend_adjust_for_fetch_type(zend_op *opline, uint32_t type) /* {{{ */
+static void zend_adjust_for_fetch_type(zend_op *opline, znode *result, uint32_t type) /* {{{ */
{
zend_uchar factor = (opline->opcode == ZEND_FETCH_STATIC_PROP_R) ? 1 : 3;
switch (type) {
case BP_VAR_R:
+ opline->result_type = IS_TMP_VAR;
+ result->op_type = IS_TMP_VAR;
return;
case BP_VAR_W:
opline->opcode += 1 * factor;
opline->opcode += 2 * factor;
return;
case BP_VAR_IS:
+ opline->result_type = IS_TMP_VAR;
+ result->op_type = IS_TMP_VAR;
opline->opcode += 3 * factor;
return;
case BP_VAR_FUNC_ARG:
opline->extended_value = ZEND_FETCH_LOCAL;
}
- zend_adjust_for_fetch_type(opline, type);
+ zend_adjust_for_fetch_type(opline, result, type);
return opline;
}
/* }}} */
static void zend_compile_simple_var(znode *result, zend_ast *ast, uint32_t type, int delayed) /* {{{ */
{
if (is_this_fetch(ast)) {
- zend_emit_op(result, ZEND_FETCH_THIS, NULL, NULL);
+ zend_op *opline = zend_emit_op(result, ZEND_FETCH_THIS, NULL, NULL);
+ if ((type == BP_VAR_R) || (type == BP_VAR_IS)) {
+ opline->result_type = IS_TMP_VAR;
+ result->op_type = IS_TMP_VAR;
+ }
} else if (zend_try_compile_cv(result, ast) == FAILURE) {
zend_compile_simple_var_no_cv(result, ast, type, delayed);
}
}
opline = zend_delayed_emit_op(result, ZEND_FETCH_DIM_R, &var_node, &dim_node);
- zend_adjust_for_fetch_type(opline, type);
+ zend_adjust_for_fetch_type(opline, result, type);
return opline;
}
/* }}} */
opline->extended_value = zend_alloc_polymorphic_cache_slot();
}
- zend_adjust_for_fetch_type(opline, type);
+ zend_adjust_for_fetch_type(opline, result, type);
return opline;
}
/* }}} */
SET_NODE(opline->op2, &class_node);
}
- zend_adjust_for_fetch_type(opline, type);
+ zend_adjust_for_fetch_type(opline, result, type);
return opline;
}
/* }}} */
opcode = ZEND_SEND_REF;
} else {
zend_compile_var(&arg_node, arg, BP_VAR_R);
- opcode = ZEND_SEND_VAR;
+ opcode = (arg_node.op_type == IS_TMP_VAR) ? ZEND_SEND_VAL : ZEND_SEND_VAR;
}
} else {
do {