@@ -3970,12 +3970,17 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) {
3970
3970
if (zend_is_variable (arg )) {
3971
3971
if (zend_is_call (arg )) {
3972
3972
zend_compile_var (& arg_node , arg , BP_VAR_R TSRMLS_CC );
3973
- opcode = ZEND_SEND_VAR_NO_REF ;
3974
- flags |= ZEND_ARG_SEND_FUNCTION ;
3975
- if (fbc && ARG_SHOULD_BE_SENT_BY_REF (fbc , arg_num )) {
3976
- flags |= ZEND_ARG_SEND_BY_REF ;
3977
- if (ARG_MAY_BE_SENT_BY_REF (fbc , arg_num )) {
3978
- flags |= ZEND_ARG_SEND_SILENT ;
3973
+ if (arg_node .op_type & (IS_CONST |IS_TMP_VAR )) {
3974
+ /* Function call was converted into builtin instruction */
3975
+ opcode = ZEND_SEND_VAL ;
3976
+ } else {
3977
+ opcode = ZEND_SEND_VAR_NO_REF ;
3978
+ flags |= ZEND_ARG_SEND_FUNCTION ;
3979
+ if (fbc && ARG_SHOULD_BE_SENT_BY_REF (fbc , arg_num )) {
3980
+ flags |= ZEND_ARG_SEND_BY_REF ;
3981
+ if (ARG_MAY_BE_SENT_BY_REF (fbc , arg_num )) {
3982
+ flags |= ZEND_ARG_SEND_SILENT ;
3983
+ }
3979
3984
}
3980
3985
}
3981
3986
} else if (fbc ) {
@@ -4108,7 +4113,7 @@ int zend_compile_func_strlen(znode *result, zend_ast_list *args TSRMLS_DC) {
4108
4113
}
4109
4114
4110
4115
zend_compile_expr (& arg_node , args -> child [0 ] TSRMLS_CC );
4111
- zend_emit_op (result , ZEND_STRLEN , & arg_node , NULL TSRMLS_CC );
4116
+ zend_emit_op_tmp (result , ZEND_STRLEN , & arg_node , NULL TSRMLS_CC );
4112
4117
return SUCCESS ;
4113
4118
}
4114
4119
@@ -4121,7 +4126,7 @@ int zend_compile_func_typecheck(znode *result, zend_ast_list *args, uint32_t typ
4121
4126
}
4122
4127
4123
4128
zend_compile_expr (& arg_node , args -> child [0 ] TSRMLS_CC );
4124
- opline = zend_emit_op (result , ZEND_TYPE_CHECK , & arg_node , NULL TSRMLS_CC );
4129
+ opline = zend_emit_op_tmp (result , ZEND_TYPE_CHECK , & arg_node , NULL TSRMLS_CC );
4125
4130
opline -> extended_value = type ;
4126
4131
return SUCCESS ;
4127
4132
}
@@ -4140,7 +4145,7 @@ int zend_compile_func_defined(znode *result, zend_ast_list *args TSRMLS_DC) {
4140
4145
return FAILURE ;
4141
4146
}
4142
4147
4143
- opline = zend_emit_op (result , ZEND_DEFINED , NULL , NULL TSRMLS_CC );
4148
+ opline = zend_emit_op_tmp (result , ZEND_DEFINED , NULL , NULL TSRMLS_CC );
4144
4149
opline -> op1_type = IS_CONST ;
4145
4150
LITERAL_STR (opline -> op1 , name );
4146
4151
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) {
6857
6862
EMPTY_SWITCH_DEFAULT_CASE ()
6858
6863
}
6859
6864
6860
- opline -> result_type = IS_TMP_VAR ;
6865
+ result -> op_type = opline -> result_type = IS_TMP_VAR ;
6861
6866
opline -> extended_value |= ast -> kind == ZEND_AST_ISSET ? ZEND_ISSET : ZEND_ISEMPTY ;
6862
6867
}
6863
6868
0 commit comments