From: Dmitry Stogov Date: Mon, 25 Apr 2005 09:58:06 +0000 (+0000) Subject: Fixed bug #29944 (Function defined in switch, crashes). X-Git-Tag: php-5.0.5RC1~380 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fae7e2bff2e4350931abde5e7c158ef0a4ce748d;p=php Fixed bug #29944 (Function defined in switch, crashes). --- diff --git a/NEWS b/NEWS index 9943097edc..2a4024a8c6 100644 --- a/NEWS +++ b/NEWS @@ -51,6 +51,7 @@ PHP NEWS - 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) diff --git a/Zend/tests/bug29944.phpt b/Zend/tests/bug29944.phpt new file mode 100644 index 0000000000..6c0cf1ec7a --- /dev/null +++ b/Zend/tests/bug29944.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #29944 (Function defined in switch, crashes) +--FILE-- + +--EXPECT-- +ok + diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 5053677bc2..72bcba6d8a 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1455,7 +1455,7 @@ static int generate_free_switch_expr(zend_switch_entry *switch_entry TSRMLS_DC) 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);