From: Dmitry Stogov Date: Mon, 25 Apr 2005 09:56:42 +0000 (+0000) Subject: Fixed bug #29944 (Function defined in switch, crashes). X-Git-Tag: php-5.0.1b1~428 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35b38598ccb521a59a98389cd776875630e81988;p=php Fixed bug #29944 (Function defined in switch, crashes). --- 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 e1c2637b52..41c0104979 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1530,7 +1530,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);