com php-src: Fixed memory leaks caused by exceptions thrown from destructors (one more case).: Zend/zend_vm_def.h Zend/z end_vm_execute.h

From: Date: Tue, 06 Dec 2016 22:43:13 +0000
Subject: com php-src: Fixed memory leaks caused by exceptions thrown from destructors (one more case).: Zend/zend_vm_def.h Zend/z end_vm_execute.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-96235@lists.php.net to get a copy of this message
Commit: 5011a11a6dad685eb2ef5ba8b150d939b58f5592 Author: Dmitry Stogov <dmitry@zend.com> Wed, 7 Dec 2016 01:43:13 +0300 Parents: e8109e09aaca9617806f41ae4d5b92460e077769 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5011a11a6dad685eb2ef5ba8b150d939b58f5592 Log: Fixed memory leaks caused by exceptions thrown from destructors (one more case). 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 da81989..6529e5a 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -7798,6 +7798,7 @@ ZEND_VM_HANDLER(157, ZEND_FETCH_CLASS_NAME, ANY, ANY, CLASS_FETCH) zend_throw_error(NULL, "Cannot use \"%s\" when no class scope is active", fetch_type == ZEND_FETCH_CLASS_SELF ? "self" : fetch_type == ZEND_FETCH_CLASS_PARENT ? "parent" : "static"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); HANDLE_EXCEPTION(); } @@ -7809,6 +7810,7 @@ ZEND_VM_HANDLER(157, ZEND_FETCH_CLASS_NAME, ANY, ANY, CLASS_FETCH) if (UNEXPECTED(scope->parent == NULL)) { zend_throw_error(NULL, "Cannot use \"parent\" when current class scope has no parent"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); HANDLE_EXCEPTION(); } ZVAL_STR_COPY(EX_VAR(opline->result.var), scope->parent->name); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 7727abd..e1d7165 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1908,6 +1908,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_HANDLER( zend_throw_error(NULL, "Cannot use \"%s\" when no class scope is active", fetch_type == ZEND_FETCH_CLASS_SELF ? "self" : fetch_type == ZEND_FETCH_CLASS_PARENT ? "parent" : "static"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); HANDLE_EXCEPTION(); } @@ -1919,6 +1920,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_HANDLER( if (UNEXPECTED(scope->parent == NULL)) { zend_throw_error(NULL, "Cannot use \"parent\" when current class scope has no parent"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); HANDLE_EXCEPTION(); } ZVAL_STR_COPY(EX_VAR(opline->result.var), scope->parent->name);

« previous php.cvs (#96235) next »