com php-src: Revert "Removed useless local variable": Zend/zend_vm_def.h Zend/zend_vm_execute.h

From: Date: Mon, 15 Dec 2014 22:44:10 +0000
Subject: com php-src: Revert "Removed useless local variable": Zend/zend_vm_def.h Zend/zend_vm_execute.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-83721@lists.php.net to get a copy of this message
Commit: caf55214165ed32014aae7863bce621d1cb19a9e Author: Dmitry Stogov <dmitry@zend.com> Tue, 16 Dec 2014 01:44:10 +0300 Parents: d9f277bd1666341d27891156635fc23eb9646c01 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=caf55214165ed32014aae7863bce621d1cb19a9e Log: Revert "Removed useless local variable" This reverts commit 44ae32ad55b9ceee9eb980edefcc62df6cff3eef. It doesn't work properly. We can't access call->scope after free. Changed paths: M Zend/zend_vm_def.h M Zend/zend_vm_execute.h Diff: diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index b947479...0bf218d 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 d459461..038953c 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;

« previous php.cvs (#83721) next »