summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index c72a972007..b7ed0980b3 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2109,7 +2109,8 @@ static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t
zend_compile_expr(&prop_node, prop_ast TSRMLS_CC);
opline = zend_delayed_emit_op(result, ZEND_FETCH_OBJ_R, &obj_node, &prop_node TSRMLS_CC);
- if (opline->op2_type == IS_CONST && Z_TYPE(CONSTANT(opline->op2.constant)) == IS_STRING) {
+ if (opline->op2_type == IS_CONST) {
+ convert_to_string(&CONSTANT(opline->op2.constant));
zend_alloc_polymorphic_cache_slot(opline->op2.constant TSRMLS_CC);
}
@@ -2477,7 +2478,12 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc TSRMLS_DC) /* {{{ *
if (fbc) {
flags |= ZEND_ARG_COMPILE_TIME_BOUND;
}
- opline->extended_value = flags;
+ if ((flags & ZEND_ARG_COMPILE_TIME_BOUND) && !(flags & ZEND_ARG_SEND_BY_REF)) {
+ opline->opcode = ZEND_SEND_VAR;
+ opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND;
+ } else {
+ opline->extended_value = flags;
+ }
} else if (fbc) {
opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND;
}
@@ -2984,9 +2990,7 @@ void zend_compile_global_var(zend_ast *ast TSRMLS_DC) /* {{{ */
zend_compile_expr(&name_node, name_ast TSRMLS_CC);
if (name_node.op_type == IS_CONST) {
- if (Z_TYPE(name_node.u.constant) != IS_STRING) {
- convert_to_string(&name_node.u.constant);
- }
+ convert_to_string(&name_node.u.constant);
}
if (zend_try_compile_cv(&result, var_ast TSRMLS_CC) == SUCCESS) {
@@ -4639,6 +4643,8 @@ static HashTable *zend_get_import_ht(uint32_t type TSRMLS_DC) /* {{{ */
return CG(current_import_const);
EMPTY_SWITCH_DEFAULT_CASE()
}
+
+ return NULL;
}
/* }}} */
@@ -4653,6 +4659,8 @@ static char *zend_get_use_type_str(uint32_t type) /* {{{ */
return " const";
EMPTY_SWITCH_DEFAULT_CASE()
}
+
+ return " unknown";
}
/* }}} */
@@ -5465,7 +5473,7 @@ void zend_compile_isset_or_empty(znode *result, zend_ast *ast TSRMLS_DC) /* {{{
zend_ast *var_ast = ast->child[0];
znode var_node;
- zend_op *opline;
+ zend_op *opline = NULL;
ZEND_ASSERT(ast->kind == ZEND_AST_ISSET || ast->kind == ZEND_AST_EMPTY);