summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-04-10 22:50:15 +0800
committerXinchen Hui <laruence@php.net>2015-04-10 22:50:15 +0800
commitc5903e79be5712d70de9a25e20db53c72f1abb1b (patch)
tree244837e5d006146029a2917f45a9639a5caf499c
parent94bea670de40c937d5926839d52dc262750921f4 (diff)
parent8ebc4431208d10fd3cc57d78ed99774f99276ff8 (diff)
downloadphp-git-c5903e79be5712d70de9a25e20db53c72f1abb1b.tar.gz
Merge branch 'PHP-5.6'
Conflicts: Zend/zend_compile.c
-rw-r--r--Zend/tests/bug69420.phpt30
-rw-r--r--Zend/zend_inheritance.c1
2 files changed, 31 insertions, 0 deletions
diff --git a/Zend/tests/bug69420.phpt b/Zend/tests/bug69420.phpt
new file mode 100644
index 0000000000..060d69c839
--- /dev/null
+++ b/Zend/tests/bug69420.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #69420 (Invalid read in zend_std_get_method)
+--FILE--
+<?php
+
+trait T {
+ protected function test() {
+ echo "okey";
+ }
+}
+
+
+class A {
+ protected function test() {
+ }
+}
+
+class B extends A {
+ use T;
+ public function foo() {
+ $this->test();
+ }
+}
+
+
+$b = new B();
+$b->foo();
+?>
+--EXPECT--
+okey
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index e203599aea..4f31529a85 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -1108,6 +1108,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
/* inherited members are overridden by members inserted by traits */
/* check whether the trait method fulfills the inheritance requirements */
do_inheritance_check_on_method(fn, existing_fn);
+ fn->common.prototype = NULL;
}
}