diff options
| author | Bob Weinand <bobwei9@hotmail.com> | 2015-05-25 19:00:53 +0200 |
|---|---|---|
| committer | Bob Weinand <bobwei9@hotmail.com> | 2015-05-25 19:00:53 +0200 |
| commit | 306a0f28d0a7591cb959793b71e8ebaeae85ed3b (patch) | |
| tree | 7dddbe3ed0677e777eebbb5b3742df391c3ceb3a | |
| parent | 21ccdf6304c40201fb749181cf4701f8fa422fbf (diff) | |
| parent | 03f41f9b4d1b068cf2fbc4090014fd8588373f85 (diff) | |
| download | php-git-306a0f28d0a7591cb959793b71e8ebaeae85ed3b.tar.gz | |
Merge branch 'master' of https://github.com/php/php-src
| -rw-r--r-- | Zend/zend_compile.c | 24 |
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); } } |
