summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-05-25 19:00:53 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-05-25 19:00:53 +0200
commit306a0f28d0a7591cb959793b71e8ebaeae85ed3b (patch)
tree7dddbe3ed0677e777eebbb5b3742df391c3ceb3a
parent21ccdf6304c40201fb749181cf4701f8fa422fbf (diff)
parent03f41f9b4d1b068cf2fbc4090014fd8588373f85 (diff)
downloadphp-git-306a0f28d0a7591cb959793b71e8ebaeae85ed3b.tar.gz
Merge branch 'master' of https://github.com/php/php-src
-rw-r--r--Zend/zend_compile.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index a6dc298cb0..458b571e5d 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2166,14 +2166,6 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint
znode name_node;
zend_op *opline;
- /* there is a chance someone is accessing $this */
- if (ast->kind != ZEND_AST_ZVAL
- && CG(active_op_array)->scope && CG(active_op_array)->this_var == (uint32_t)-1
- ) {
- zend_string *key = zend_string_init("this", sizeof("this") - 1, 0);
- CG(active_op_array)->this_var = lookup_cv(CG(active_op_array), key);
- }
-
zend_compile_expr(&name_node, name_ast);
if (name_node.op_type == IS_CONST) {
convert_to_string(&name_node.u.constant);
@@ -2185,10 +2177,18 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint
opline = zend_emit_op(result, ZEND_FETCH_R, &name_node, NULL);
}
- opline->extended_value = ZEND_FETCH_LOCAL;
- if (name_node.op_type == IS_CONST) {
- if (zend_is_auto_global(Z_STR(name_node.u.constant))) {
- opline->extended_value = ZEND_FETCH_GLOBAL;
+ if (name_node.op_type == IS_CONST &&
+ zend_is_auto_global(Z_STR(name_node.u.constant))) {
+
+ opline->extended_value = ZEND_FETCH_GLOBAL;
+ } else {
+ opline->extended_value = ZEND_FETCH_LOCAL;
+ /* there is a chance someone is accessing $this */
+ if (ast->kind != ZEND_AST_ZVAL
+ && CG(active_op_array)->scope && CG(active_op_array)->this_var == (uint32_t)-1
+ ) {
+ zend_string *key = zend_string_init("this", sizeof("this") - 1, 0);
+ CG(active_op_array)->this_var = lookup_cv(CG(active_op_array), key);
}
}