From d72ac0771d6259d9426d7d324f08aabd03987145 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 23 Nov 2010 10:22:34 +0000 Subject: [PATCH] Fixed bug #35547 (Segfault accessing static method) --- Zend/tests/bug53347.phpt | 17 +++++++++++++++++ Zend/zend_compile.c | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/bug53347.phpt diff --git a/Zend/tests/bug53347.phpt b/Zend/tests/bug53347.phpt new file mode 100644 index 0000000000..66e4ec261d --- /dev/null +++ b/Zend/tests/bug53347.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #53347 Segfault accessing static method +--FILE-- + 30 ); + + public static function isValidFormatCode( $type, $key ) + { + return isset( self::${$type}[$key] ); + } +} + +var_dump( ezcConsoleOutput::isValidFormatCode( 'color', 'gray' ) ); +?> +--EXPECT-- +bool(true) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index ec741f9e10..3543df829e 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -777,7 +777,7 @@ void zend_do_fetch_static_member(znode *result, znode *class_name TSRMLS_DC) /* opline_ptr->op2.constant = zend_add_class_name_literal(CG(active_op_array), &class_node.u.constant TSRMLS_CC); } else { - SET_NODE(opline.op2, &class_node); + SET_NODE(opline_ptr->op2, &class_node); } opline_ptr->extended_value |= ZEND_FETCH_STATIC_MEMBER; } -- 2.40.0