]> granicus.if.org Git - php/commitdiff
Fixed bug #35547 (Segfault accessing static method)
authorDmitry Stogov <dmitry@php.net>
Tue, 23 Nov 2010 10:22:34 +0000 (10:22 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 23 Nov 2010 10:22:34 +0000 (10:22 +0000)
Zend/tests/bug53347.phpt [new file with mode: 0644]
Zend/zend_compile.c

diff --git a/Zend/tests/bug53347.phpt b/Zend/tests/bug53347.phpt
new file mode 100644 (file)
index 0000000..66e4ec2
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+Bug #53347 Segfault accessing static method
+--FILE--
+<?php class ezcConsoleOutput
+{
+    protected static $color = array( 'gray' => 30 );
+
+    public static function isValidFormatCode( $type, $key )
+    {
+        return isset( self::${$type}[$key] );
+    }
+}
+
+var_dump( ezcConsoleOutput::isValidFormatCode( 'color', 'gray' ) );
+?>
+--EXPECT--
+bool(true)
index ec741f9e108620359b34a26e9d3f2c94c8b96b32..3543df829e03602c89176eae39da05c521dd3ad4 100644 (file)
@@ -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;
                }