PHP :: Bug #69420 :: Invalid read in zend_std_get_method
[2015-04-10 14:50 UTC] laruence@php.net
Description:
------------
none
Test script:
---------------
<?php
trait T {
protected function test() {}
}
class A {
protected function test() {
}
}
class B extends A {
use T;
public function foo() {
$this->test();
}
}
$b = new B();
$b->foo();
Expected result:
----------------
nothing with valgrind
Actual result:
--------------
==6262== Invalid read of size 8
==6262== at 0x84CF2B: zend_std_get_method (zend_object_handlers.c:1103)
==6262== by 0x86C9B4: ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER (zend_vm_execute.h:25480)
==6262== by 0x85D207: execute_ex (zend_vm_execute.h:363)
==6262== by 0x8243DF: zend_execute_scripts (zend.c:1341)
==6262== by 0x7C2121: php_execute_script (main.c:2597)
==6262== by 0x8C83EE: do_cli (php_cli.c:994)
==6262== by 0x4415CF: main (php_cli.c:1378)
==6262== Address 0xf7a3940 is 16 bytes inside a block of size 248 free'd
==6262== at 0x4C2CE8E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6262== by 0x82FB0C: _zend_hash_quick_add_or_update (zend_hash.c:335)
==6262== by 0x803D49: zend_add_trait_method (zend_compile.c:4088)
==6262== by 0x804477: zend_traits_copy_functions (zend_compile.c:4187)
==6262== by 0x830A07: zend_hash_apply_with_arguments (zend_hash.c:701)
==6262== by 0x80754D: zend_do_bind_traits (zend_compile.c:4357)
==6262== by 0x864E33: ZEND_BIND_TRAITS_SPEC_HANDLER (zend_vm_execute.h:1163)
==6262== by 0x85D207: execute_ex (zend_vm_execute.h:363)
==6262== by 0x8243DF: zend_execute_scripts (zend.c:1341)
==6262== by 0x7C2121: php_execute_script (main.c:2597)
==6262== by 0x8C83EE: do_cli (php_cli.c:994)
==6262== by 0x4415CF: main (php_cli.c:1378)
==6262==