diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-12-16 01:44:10 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-12-16 01:44:10 +0300 |
commit | caf55214165ed32014aae7863bce621d1cb19a9e (patch) | |
tree | 1b47d1d97b03f4539e42372cb2a3b48b81f4ccab | |
parent | d9f277bd1666341d27891156635fc23eb9646c01 (diff) | |
download | php-git-caf55214165ed32014aae7863bce621d1cb19a9e.tar.gz |
Revert "Removed useless local variable"
This reverts commit 44ae32ad55b9ceee9eb980edefcc62df6cff3eef.
It doesn't work properly. We can't access call->scope after free.
-rw-r--r-- | Zend/zend_vm_def.h | 6 | ||||
-rw-r--r-- | Zend/zend_vm_execute.h | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index b9474793fb..0bf218d581 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2771,9 +2771,11 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY) LOAD_OPLINE(); if (UNEXPECTED(fbc->type == ZEND_INTERNAL_FUNCTION)) { + int should_change_scope = 0; zval *ret; if (fbc->common.scope) { + should_change_scope = 1; /* TODO: we don't set scope if we call an object method ??? */ /* See: ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt */ #if 1 @@ -2804,7 +2806,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY) if (RETURN_VALUE_USED(opline)) { ZVAL_UNDEF(EX_VAR(opline->result.var)); } - if (UNEXPECTED(fbc->common.scope)) { + if (UNEXPECTED(should_change_scope)) { ZEND_VM_C_GOTO(fcall_end_change_scope); } else { ZEND_VM_C_GOTO(fcall_end); @@ -2830,7 +2832,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY) zval_ptr_dtor(ret); } - if (UNEXPECTED(fbc->common.scope)) { + if (UNEXPECTED(should_change_scope)) { ZEND_VM_C_GOTO(fcall_end_change_scope); } else { ZEND_VM_C_GOTO(fcall_end); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index d459461169..038953ccd4 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -513,9 +513,11 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) LOAD_OPLINE(); if (UNEXPECTED(fbc->type == ZEND_INTERNAL_FUNCTION)) { + int should_change_scope = 0; zval *ret; if (fbc->common.scope) { + should_change_scope = 1; /* TODO: we don't set scope if we call an object method ??? */ /* See: ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt */ #if 1 @@ -546,7 +548,7 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (RETURN_VALUE_USED(opline)) { ZVAL_UNDEF(EX_VAR(opline->result.var)); } - if (UNEXPECTED(fbc->common.scope)) { + if (UNEXPECTED(should_change_scope)) { goto fcall_end_change_scope; } else { goto fcall_end; @@ -572,7 +574,7 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval_ptr_dtor(ret); } - if (UNEXPECTED(fbc->common.scope)) { + if (UNEXPECTED(should_change_scope)) { goto fcall_end_change_scope; } else { goto fcall_end; |