cvs: ZendEngine2(PHP_5_0) / zend_compile.c /tests bug29944.phpt php-src NEWS
| From: | Dmitry Stogov | Date: | Mon, 25 Apr 2005 09:58:07 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_0) / zend_compile.c /tests bug29944.phpt php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3584@lists.php.net to get a copy of this message | ||
dmitry Mon Apr 25 05:58:07 2005 EDT
Added files: (Branch: PHP_5_0)
/ZendEngine2/tests bug29944.phpt
Modified files:
/php-src NEWS
/ZendEngine2 zend_compile.c
Log:
Fixed bug #29944 (Function defined in switch, crashes).
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.343&r2=1.1760.2.344&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.343 php-src/NEWS:1.1760.2.344
--- php-src/NEWS:1.1760.2.343 Mon Apr 25 05:11:47 2005
+++ php-src/NEWS Mon Apr 25 05:58:03 2005
@@ -51,6 +51,7 @@
- Fixed bug #31363 (broken non-blocking flock()). ian at snork dot net
- Fixed bug #30833 (array_count_values() modifying input array). (Tony)
- Fixed bug #30819 (Better support for LDAP SASL bind). (Jani)
+- Fixed bug #29944 (Function defined in switch, crashes). (Dmitry)
- Fixed bug #29583 (crash when echoing a COM object). (M.Sisolak, Wez)
- Fixed bug #28839 (SIGSEGV in interactive mode (php -a)).
(kameshj at fastmail dot fm)
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.567.2.15&r2=1.567.2.16&ty=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.567.2.15 ZendEngine2/zend_compile.c:1.567.2.16
--- ZendEngine2/zend_compile.c:1.567.2.15 Thu Mar 10 08:24:32 2005
+++ ZendEngine2/zend_compile.c Mon Apr 25 05:58:06 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.567.2.15 2005/03/10 13:24:32 helly Exp $ */
+/* $Id: zend_compile.c,v 1.567.2.16 2005/04/25 09:58:06 dmitry Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -1455,7 +1455,7 @@
zend_op *opline;
if (switch_entry->cond.op_type != IS_VAR && switch_entry->cond.op_type !=
IS_TMP_VAR) {
- return 0;
+ return (switch_entry->cond.op_type == IS_UNUSED);
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
http://cvs.php.net/co.php/ZendEngine2/tests/bug29944.phpt?r=1.1&p=1
Index: ZendEngine2/tests/bug29944.phpt
+++ ZendEngine2/tests/bug29944.phpt
--TEST--
Bug #29944 (Function defined in switch, crashes)
--FILE--
<?php
$a = 1;
switch ($a) {
case 1:
function foo($a) {
return "ok\n";
}
echo foo($a);
}
?>
--EXPECT--
ok