cvs: ZendEngine2 / zend_compile.c /tests bug43027.phpt

From: Date: Thu, 01 Nov 2007 11:59:15 +0000
Subject: cvs: ZendEngine2 / zend_compile.c /tests bug43027.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6116@lists.php.net to get a copy of this message
dmitry Thu Nov 1 11:59:15 2007 UTC Modified files: /ZendEngine2 zend_compile.c /ZendEngine2/tests bug43027.phpt Log: Fixed bug #43027 (Declare cause fatal error) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.775&r2=1.776&diff_format=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.775 ZendEngine2/zend_compile.c:1.776 --- ZendEngine2/zend_compile.c:1.775 Tue Oct 23 12:52:51 2007 +++ ZendEngine2/zend_compile.c Thu Nov 1 11:59:15 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.775 2007/10/23 12:52:51 dmitry Exp $ */ +/* $Id: zend_compile.c,v 1.776 2007/11/01 11:59:15 dmitry Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -4496,10 +4496,11 @@ * want to tell them to put declare() at the top. */ if (CG(active_op_array)->last > 0) { - /* ignore ZEND_EXT_STMT */ + /* ignore ZEND_EXT_STMT and ZEND_TICKS */ int num = CG(active_op_array)->last; while (num > 0 && - CG(active_op_array)->opcodes[num-1].opcode == ZEND_EXT_STMT) { + (CG(active_op_array)->opcodes[num-1].opcode == ZEND_EXT_STMT || + CG(active_op_array)->opcodes[num-1].opcode == ZEND_TICKS)) { --num; } if (num > 0) { @@ -5075,10 +5076,11 @@ zstr lcname; if (CG(active_op_array)->last > 0) { - /* ignore ZEND_EXT_STMT */ + /* ignore ZEND_EXT_STMT and ZEND_TICKS */ int num = CG(active_op_array)->last; while (num > 0 && - CG(active_op_array)->opcodes[num-1].opcode == ZEND_EXT_STMT) { + (CG(active_op_array)->opcodes[num-1].opcode == ZEND_EXT_STMT || + CG(active_op_array)->opcodes[num-1].opcode == ZEND_TICKS)) { --num; } if (num > 0) { http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug43027.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/bug43027.phpt diff -u /dev/null ZendEngine2/tests/bug43027.phpt:1.2 --- /dev/null Thu Nov 1 11:59:15 2007 +++ ZendEngine2/tests/bug43027.phpt Thu Nov 1 11:59:15 2007 @@ -0,0 +1,10 @@ +--TEST-- +Bug #43027 (Declare cause fatal error) +--FILE-- +<?php +declare(ticks=1); +namespace test; +echo "ok\n"; +?> +--EXPECT-- +ok

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