com php-src: Minor fetch type adjustment cleanup: Zend/zend_c ompile.c
| From: | Nikita Popov | Date: | Thu, 16 Nov 2017 21:13:07 +0000 |
| Subject: | com php-src: Minor fetch type adjustment cleanup: Zend/zend_c ompile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100283@lists.php.net to get a copy of this message | ||
Commit: d9da166649c2cd0b7811fef1d82f4fef8285578e
Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 16 Nov 2017 22:12:45 +0100
Parents: a164e91dfb5378e546a4184569d4e7e6a1147d7a
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d9da166649c2cd0b7811fef1d82f4fef8285578e
Log:
Minor fetch type adjustment cleanup
No need to call adjust_fetch_type on FETCH_THIS, just to special
case it in adjust_fetch_type...
Changed paths:
M Zend/zend_compile.c
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 85d5abb..3a130de 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1934,10 +1934,6 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
static void zend_adjust_for_fetch_type(zend_op *opline, uint32_t type) /* {{{ */
{
zend_uchar factor = (opline->opcode == ZEND_FETCH_STATIC_PROP_R) ? 1 : 3;
-
- if (opline->opcode == ZEND_FETCH_THIS) {
- return;
- }
switch (type & BP_VAR_MASK) {
case BP_VAR_R:
@@ -2631,11 +2627,8 @@ static zend_bool is_this_fetch(zend_ast *ast) /* {{{ */
static void zend_compile_simple_var(znode *result, zend_ast *ast, uint32_t type, int delayed) /*
{{{ */
{
- zend_op *opline;
-
if (is_this_fetch(ast)) {
- opline = zend_emit_op(result, ZEND_FETCH_THIS, NULL, NULL);
- zend_adjust_for_fetch_type(opline, type);
+ zend_emit_op(result, ZEND_FETCH_THIS, NULL, NULL);
} else if (zend_try_compile_cv(result, ast) == FAILURE) {
zend_op *opline = zend_compile_simple_var_no_cv(result, ast, type, delayed);
zend_adjust_for_fetch_type(opline, type);