com php-src: Make internal non-static methods to be executed in context of class. Set EG(scope) accordingly.: Zend/zend_vm_def.h Z
end/zend_vm_execute.h ext/pdo_sqlite/tests/pdo_fetc h_func_001.phpt
| From: | Dmitry Stogov | Date: | Thu, 23 Apr 2015 00:41:50 +0000 |
| Subject: | com php-src: Make internal non-static methods to be executed in context of class. Set EG(scope) accordingly.: Zend/zend_vm_def.h Z end/zend_vm_execute.h ext/pdo_sqlite/tests/pdo_fetc h_func_001.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86451@lists.php.net to get a copy of this message | ||
Commit: 6d4da2db8a5e77391182db271e1ed8e4e56eca88
Author: Dmitry Stogov <dmitry@zend.com> Thu, 23 Apr 2015 03:41:50 +0300
Parents: 15a5f61cf4ac1961c20b61ba58e19c64a653064c
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6d4da2db8a5e77391182db271e1ed8e4e56eca88
Log:
Make internal non-static methods to be executed in context of class. Set EG(scope) accordingly.
Changed paths:
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
M ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt
Diff:
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 16d3a23..9a50c9b 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -3626,13 +3626,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
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
- EG(scope) = object ? NULL : fbc->common.scope;
-#else
EG(scope) = fbc->common.scope;
-#endif
} else {
call->called_scope = EX(called_scope);
Z_OBJ(call->This) = Z_OBJ(EX(This));
@@ -7788,8 +7782,6 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY)
ZEND_ASSERT(!(fbc->common.fn_flags & ZEND_ACC_GENERATOR));
- /* This must be already set on invokation of trampoline function */
- /*EG(scope) = fbc->common.scope;*/
call->symbol_table = NULL;
i_init_func_execute_data(call, &fbc->op_array,
ret, (fbc->common.fn_flags & ZEND_ACC_STATIC) == 0);
@@ -7805,7 +7797,6 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY)
ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION);
- EG(scope) = object ? NULL : fbc->common.scope;
EG(current_execute_data) = call;
if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) {
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 0472feb..9f224ee 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -783,13 +783,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL
ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPC
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
- EG(scope) = object ? NULL : fbc->common.scope;
-#else
EG(scope) = fbc->common.scope;
-#endif
} else {
call->called_scope = EX(called_scope);
Z_OBJ(call->This) = Z_OBJ(EX(This));
@@ -1814,8 +1808,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL
ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z
ZEND_ASSERT(!(fbc->common.fn_flags & ZEND_ACC_GENERATOR));
- /* This must be already set on invokation of trampoline function */
- /*EG(scope) = fbc->common.scope;*/
call->symbol_table = NULL;
i_init_func_execute_data(call, &fbc->op_array,
ret, (fbc->common.fn_flags & ZEND_ACC_STATIC) == 0);
@@ -1831,7 +1823,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL
ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z
ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION);
- EG(scope) = object ? NULL : fbc->common.scope;
EG(current_execute_data) = call;
if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) {
diff --git a/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt
b/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt
index f7f3ce0..c8cdee6 100644
--- a/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt
+++ b/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt
@@ -102,7 +102,7 @@ bool(false)
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: no array or string given in %s
on line %d
bool(false)
-Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: cannot access self:: when no
class scope is active in %s on line %d
+Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: class 'PDOStatement'
does not have a method 'foo' in %s on line %d
bool(false)
array(2) {
[0]=>