From 35b38598ccb521a59a98389cd776875630e81988 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 25 Apr 2005 09:56:42 +0000 Subject: [PATCH] Fixed bug #29944 (Function defined in switch, crashes). --- Zend/tests/bug29944.phpt | 16 ++++++++++++++++ Zend/zend_compile.c | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/bug29944.phpt 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); -- 2.50.1