cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /tests bug30707.phpt

From: Date: Wed, 04 May 2005 11:17:30 +0000
Subject: cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /tests bug30707.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-3642@lists.php.net to get a copy of this message
dmitry Wed May 4 07:17:30 2005 EDT Modified files: /ZendEngine2 zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /ZendEngine2/tests bug30707.phpt Log: Fixed bug #30707 (Segmentation fault on exception in method) http://cvs.php.net/diff.php/ZendEngine2/zend_vm_def.h?r1=1.24&r2=1.25&ty=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.24 ZendEngine2/zend_vm_def.h:1.25 --- ZendEngine2/zend_vm_def.h:1.24 Wed May 4 04:45:45 2005 +++ ZendEngine2/zend_vm_def.h Wed May 4 07:17:28 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_def.h,v 1.24 2005/05/04 08:45:45 dmitry Exp $ */ +/* $Id: zend_vm_def.h,v 1.25 2005/05/04 11:17:28 dmitry Exp $ */ ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) { @@ -3506,6 +3506,13 @@ } } + while (EX(fbc)) { + if (EX(object)) { + zval_ptr_dtor(&EX(object)); + } + zend_ptr_stack_n_pop(&EG(arg_types_stack), 3, &EX(calling_scope), &EX(object), &EX(fbc)); + } + if (encapsulating_block == -1) { ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); } else { http://cvs.php.net/diff.php/ZendEngine2/zend_vm_execute.h?r1=1.26&r2=1.27&ty=u Index: ZendEngine2/zend_vm_execute.h diff -u ZendEngine2/zend_vm_execute.h:1.26 ZendEngine2/zend_vm_execute.h:1.27 --- ZendEngine2/zend_vm_execute.h:1.26 Wed May 4 04:45:45 2005 +++ ZendEngine2/zend_vm_execute.h Wed May 4 07:17:28 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_execute.h,v 1.26 2005/05/04 08:45:45 dmitry Exp $ */ +/* $Id: zend_vm_execute.h,v 1.27 2005/05/04 11:17:28 dmitry Exp $ */ #define ZEND_VM_CONTINUE() return 0 @@ -491,6 +491,13 @@ } } + while (EX(fbc)) { + if (EX(object)) { + zval_ptr_dtor(&EX(object)); + } + zend_ptr_stack_n_pop(&EG(arg_types_stack), 3, &EX(calling_scope), &EX(object), &EX(fbc)); + } + if (encapsulating_block == -1) { ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); } else { @@ -32441,6 +32448,13 @@ } } + while (EX(fbc)) { + if (EX(object)) { + zval_ptr_dtor(&EX(object)); + } + zend_ptr_stack_n_pop(&EG(arg_types_stack), 3, &EX(calling_scope), &EX(object), &EX(fbc)); + } + if (encapsulating_block == -1) { ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); } else { http://cvs.php.net/diff.php/ZendEngine2/zend_vm_opcodes.h?r1=1.13&r2=1.14&ty=u Index: ZendEngine2/zend_vm_opcodes.h diff -u ZendEngine2/zend_vm_opcodes.h:1.13 ZendEngine2/zend_vm_opcodes.h:1.14 --- ZendEngine2/zend_vm_opcodes.h:1.13 Wed May 4 04:45:45 2005 +++ ZendEngine2/zend_vm_opcodes.h Wed May 4 07:17:30 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_opcodes.h,v 1.13 2005/05/04 08:45:45 dmitry Exp $ */ +/* $Id: zend_vm_opcodes.h,v 1.14 2005/05/04 11:17:30 dmitry Exp $ */ #define ZEND_NOP 0 #define ZEND_ADD 1 http://cvs.php.net/diff.php/ZendEngine2/tests/bug30707.phpt?r1=1.1&r2=1.2&ty=u Index: ZendEngine2/tests/bug30707.phpt diff -u /dev/null ZendEngine2/tests/bug30707.phpt:1.2 --- /dev/null Wed May 4 07:17:30 2005 +++ ZendEngine2/tests/bug30707.phpt Wed May 4 07:17:30 2005 @@ -0,0 +1,29 @@ +--TEST-- +Bug #30707 (Segmentation fault on exception in method) +--FILE-- +<?php +class C { + function byePHP($plop) { + echo "ok\n"; + } + + function plip() { + try { + $this->plap($this->plop()); + } catch(Exception $e) { + } + } + + function plap($a) { + } + + function plop() { + throw new Exception; + } +} + +$x = new C; +$x->byePHP($x->plip()); +?> +--EXPECT-- +ok

« previous php.zend-engine.cvs (#3642) next »