mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00
Fixed return operand type (Use IS_TMP_VAR instead of IS_VAR in the same way as it was before AST patch)
This commit is contained in:
parent
7cbbb37127
commit
055b632e7d
2 changed files with 17 additions and 12 deletions
|
@ -3970,6 +3970,10 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) {
|
||||||
if (zend_is_variable(arg)) {
|
if (zend_is_variable(arg)) {
|
||||||
if (zend_is_call(arg)) {
|
if (zend_is_call(arg)) {
|
||||||
zend_compile_var(&arg_node, arg, BP_VAR_R TSRMLS_CC);
|
zend_compile_var(&arg_node, arg, BP_VAR_R TSRMLS_CC);
|
||||||
|
if (arg_node.op_type & (IS_CONST|IS_TMP_VAR)) {
|
||||||
|
/* Function call was converted into builtin instruction */
|
||||||
|
opcode = ZEND_SEND_VAL;
|
||||||
|
} else {
|
||||||
opcode = ZEND_SEND_VAR_NO_REF;
|
opcode = ZEND_SEND_VAR_NO_REF;
|
||||||
flags |= ZEND_ARG_SEND_FUNCTION;
|
flags |= ZEND_ARG_SEND_FUNCTION;
|
||||||
if (fbc && ARG_SHOULD_BE_SENT_BY_REF(fbc, arg_num)) {
|
if (fbc && ARG_SHOULD_BE_SENT_BY_REF(fbc, arg_num)) {
|
||||||
|
@ -3978,6 +3982,7 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) {
|
||||||
flags |= ZEND_ARG_SEND_SILENT;
|
flags |= ZEND_ARG_SEND_SILENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (fbc) {
|
} else if (fbc) {
|
||||||
if (ARG_SHOULD_BE_SENT_BY_REF(fbc, arg_num)) {
|
if (ARG_SHOULD_BE_SENT_BY_REF(fbc, arg_num)) {
|
||||||
zend_compile_var(&arg_node, arg, BP_VAR_W TSRMLS_CC);
|
zend_compile_var(&arg_node, arg, BP_VAR_W TSRMLS_CC);
|
||||||
|
@ -4108,7 +4113,7 @@ int zend_compile_func_strlen(znode *result, zend_ast_list *args TSRMLS_DC) {
|
||||||
}
|
}
|
||||||
|
|
||||||
zend_compile_expr(&arg_node, args->child[0] TSRMLS_CC);
|
zend_compile_expr(&arg_node, args->child[0] TSRMLS_CC);
|
||||||
zend_emit_op(result, ZEND_STRLEN, &arg_node, NULL TSRMLS_CC);
|
zend_emit_op_tmp(result, ZEND_STRLEN, &arg_node, NULL TSRMLS_CC);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4121,7 +4126,7 @@ int zend_compile_func_typecheck(znode *result, zend_ast_list *args, uint32_t typ
|
||||||
}
|
}
|
||||||
|
|
||||||
zend_compile_expr(&arg_node, args->child[0] TSRMLS_CC);
|
zend_compile_expr(&arg_node, args->child[0] TSRMLS_CC);
|
||||||
opline = zend_emit_op(result, ZEND_TYPE_CHECK, &arg_node, NULL TSRMLS_CC);
|
opline = zend_emit_op_tmp(result, ZEND_TYPE_CHECK, &arg_node, NULL TSRMLS_CC);
|
||||||
opline->extended_value = type;
|
opline->extended_value = type;
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -4140,7 +4145,7 @@ int zend_compile_func_defined(znode *result, zend_ast_list *args TSRMLS_DC) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
opline = zend_emit_op(result, ZEND_DEFINED, NULL, NULL TSRMLS_CC);
|
opline = zend_emit_op_tmp(result, ZEND_DEFINED, NULL, NULL TSRMLS_CC);
|
||||||
opline->op1_type = IS_CONST;
|
opline->op1_type = IS_CONST;
|
||||||
LITERAL_STR(opline->op1, name);
|
LITERAL_STR(opline->op1, name);
|
||||||
zend_alloc_cache_slot(opline->op1.constant TSRMLS_CC);
|
zend_alloc_cache_slot(opline->op1.constant TSRMLS_CC);
|
||||||
|
@ -6857,7 +6862,7 @@ void zend_compile_isset_or_empty(znode *result, zend_ast *ast TSRMLS_DC) {
|
||||||
EMPTY_SWITCH_DEFAULT_CASE()
|
EMPTY_SWITCH_DEFAULT_CASE()
|
||||||
}
|
}
|
||||||
|
|
||||||
opline->result_type = IS_TMP_VAR;
|
result->op_type = opline->result_type = IS_TMP_VAR;
|
||||||
opline->extended_value |= ast->kind == ZEND_AST_ISSET ? ZEND_ISSET : ZEND_ISEMPTY;
|
opline->extended_value |= ast->kind == ZEND_AST_ISSET ? ZEND_ISSET : ZEND_ISEMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -472,7 +472,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
|
||||||
zval t;
|
zval t;
|
||||||
|
|
||||||
ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(opline)));
|
ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(opline)));
|
||||||
replace_var_by_const(op_array, opline + 1, ZEND_RESULT(opline).var, &t TSRMLS_CC);
|
replace_tmp_by_const(op_array, opline + 1, ZEND_RESULT(opline).var, &t TSRMLS_CC);
|
||||||
literal_dtor(&ZEND_OP1_LITERAL(opline));
|
literal_dtor(&ZEND_OP1_LITERAL(opline));
|
||||||
MAKE_NOP(opline);
|
MAKE_NOP(opline);
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ZVAL_TRUE(&c);
|
ZVAL_TRUE(&c);
|
||||||
replace_var_by_const(op_array, opline, tv, &c TSRMLS_CC);
|
replace_tmp_by_const(op_array, opline, tv, &c TSRMLS_CC);
|
||||||
literal_dtor(&ZEND_OP1_LITERAL(opline));
|
literal_dtor(&ZEND_OP1_LITERAL(opline));
|
||||||
MAKE_NOP(opline);
|
MAKE_NOP(opline);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue