From: Dmitry Stogov Date: Tue, 23 Nov 2010 10:22:34 +0000 (+0000) Subject: Fixed bug #35547 (Segfault accessing static method) X-Git-Tag: php-5.4.0alpha1~191^2~613 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d72ac0771d6259d9426d7d324f08aabd03987145;p=php Fixed bug #35547 (Segfault accessing static method) --- 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; }