opline->extended_value = ZEND_FETCH_LOCAL;
}
+ zend_adjust_for_fetch_type(opline, type);
return opline;
}
/* }}} */
if (is_this_fetch(ast)) {
zend_emit_op(result, ZEND_FETCH_THIS, NULL, NULL);
} else if (zend_try_compile_cv(result, ast) == FAILURE) {
- zend_op *opline = zend_compile_simple_var_no_cv(result, ast, type, delayed);
- zend_adjust_for_fetch_type(opline, type);
+ zend_compile_simple_var_no_cv(result, ast, type, delayed);
}
}
/* }}} */
{
zend_ast *var_ast = ast->child[0];
zend_ast *dim_ast = ast->child[1];
+ zend_op *opline;
znode var_node, dim_node;
zend_handle_numeric_op(&dim_node);
}
- return zend_delayed_emit_op(result, ZEND_FETCH_DIM_R, &var_node, &dim_node);
+ opline = zend_delayed_emit_op(result, ZEND_FETCH_DIM_R, &var_node, &dim_node);
+ zend_adjust_for_fetch_type(opline, type);
+ return opline;
}
/* }}} */
-static inline zend_op *zend_compile_dim_common(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
+static zend_op *zend_compile_dim(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
uint32_t offset = zend_delayed_compile_begin();
zend_delayed_compile_dim(result, ast, type);
}
/* }}} */
-void zend_compile_dim(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
-{
- zend_op *opline = zend_compile_dim_common(result, ast, type);
- zend_adjust_for_fetch_type(opline, type);
-}
-/* }}} */
-
static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
zend_ast *obj_ast = ast->child[0];
zend_alloc_polymorphic_cache_slot(opline->op2.constant);
}
+ zend_adjust_for_fetch_type(opline, type);
return opline;
}
/* }}} */
-static zend_op *zend_compile_prop_common(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
+static zend_op *zend_compile_prop(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
uint32_t offset = zend_delayed_compile_begin();
zend_delayed_compile_prop(result, ast, type);
}
/* }}} */
-void zend_compile_prop(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
-{
- zend_op *opline = zend_compile_prop_common(result, ast, type);
- zend_adjust_for_fetch_type(opline, type);
-}
-/* }}} */
-
-zend_op *zend_compile_static_prop_common(znode *result, zend_ast *ast, uint32_t type, int delayed) /* {{{ */
+zend_op *zend_compile_static_prop(znode *result, zend_ast *ast, uint32_t type, int delayed) /* {{{ */
{
zend_ast *class_ast = ast->child[0];
zend_ast *prop_ast = ast->child[1];
SET_NODE(opline->op2, &class_node);
}
- return opline;
-}
-/* }}} */
-
-void zend_compile_static_prop(znode *result, zend_ast *ast, uint32_t type, int delayed) /* {{{ */
-{
- zend_op *opline = zend_compile_static_prop_common(result, ast, type, delayed);
zend_adjust_for_fetch_type(opline, type);
+ return opline;
}
/* }}} */
}
return;
case ZEND_AST_DIM:
- opline = zend_compile_dim_common(NULL, var_ast, BP_VAR_UNSET);
+ opline = zend_compile_dim(NULL, var_ast, BP_VAR_UNSET);
opline->opcode = ZEND_UNSET_DIM;
return;
case ZEND_AST_PROP:
- opline = zend_compile_prop_common(NULL, var_ast, BP_VAR_UNSET);
+ opline = zend_compile_prop(NULL, var_ast, BP_VAR_UNSET);
opline->opcode = ZEND_UNSET_OBJ;
return;
case ZEND_AST_STATIC_PROP:
- opline = zend_compile_static_prop_common(NULL, var_ast, BP_VAR_UNSET, 0);
+ opline = zend_compile_static_prop(NULL, var_ast, BP_VAR_UNSET, 0);
opline->opcode = ZEND_UNSET_STATIC_PROP;
return;
EMPTY_SWITCH_DEFAULT_CASE()
zend_ensure_writable_variable(var_ast);
if (var_ast->kind == ZEND_AST_PROP) {
- zend_op *opline = zend_compile_prop_common(NULL, var_ast, BP_VAR_RW);
+ zend_op *opline = zend_compile_prop(NULL, var_ast, BP_VAR_RW);
opline->opcode = ast->kind == ZEND_AST_POST_INC ? ZEND_POST_INC_OBJ : ZEND_POST_DEC_OBJ;
zend_make_tmp_result(result, opline);
} else {
zend_ensure_writable_variable(var_ast);
if (var_ast->kind == ZEND_AST_PROP) {
- zend_op *opline = zend_compile_prop_common(result, var_ast, BP_VAR_RW);
+ zend_op *opline = zend_compile_prop(result, var_ast, BP_VAR_RW);
opline->opcode = ast->kind == ZEND_AST_PRE_INC ? ZEND_PRE_INC_OBJ : ZEND_PRE_DEC_OBJ;
} else {
znode var_node;
}
break;
case ZEND_AST_DIM:
- opline = zend_compile_dim_common(result, var_ast, BP_VAR_IS);
+ opline = zend_compile_dim(result, var_ast, BP_VAR_IS);
opline->opcode = ZEND_ISSET_ISEMPTY_DIM_OBJ;
break;
case ZEND_AST_PROP:
- opline = zend_compile_prop_common(result, var_ast, BP_VAR_IS);
+ opline = zend_compile_prop(result, var_ast, BP_VAR_IS);
opline->opcode = ZEND_ISSET_ISEMPTY_PROP_OBJ;
break;
case ZEND_AST_STATIC_PROP:
- opline = zend_compile_static_prop_common(result, var_ast, BP_VAR_IS, 0);
+ opline = zend_compile_static_prop(result, var_ast, BP_VAR_IS, 0);
opline->opcode = ZEND_ISSET_ISEMPTY_STATIC_PROP;
break;
EMPTY_SWITCH_DEFAULT_CASE()
void zend_delayed_compile_var(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
- zend_op *opline;
switch (ast->kind) {
case ZEND_AST_VAR:
zend_compile_simple_var(result, ast, type, 1);
return;
case ZEND_AST_DIM:
- opline = zend_delayed_compile_dim(result, ast, type);
- zend_adjust_for_fetch_type(opline, type);
+ zend_delayed_compile_dim(result, ast, type);
return;
case ZEND_AST_PROP:
- opline = zend_delayed_compile_prop(result, ast, type);
- zend_adjust_for_fetch_type(opline, type);
+ zend_delayed_compile_prop(result, ast, type);
return;
case ZEND_AST_STATIC_PROP:
zend_compile_static_prop(result, ast, type, 1);