Bug #62907 [Opn]: Double free when use traits
Edit report at https://bugs.php.net/bug.php?id=62907&edit=1
ID: 62907
Updated by: laruence@php.net
Reported by: laruence@php.net
Summary: Double free when use traits
Status: Open
Type: Bug
Package: Scripting Engine problem
PHP Version: 5.4.6
-Assigned To:
+Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
assign to my self.
Previous Comments:
------------------------------------------------------------------------
[2012-08-23 15:31:43] laruence@php.net
Description:
------------
This bug is related to #61998, but was spotting when I fixing the bug #62358, PS:
it really tough to refine this reproduce script :)
Test script:
---------------
<?php
function __autoload($name) {
if ($name == "B") {
eval ("abstract class B extends A { }");
} else if ($name == "A") {
eval ("abstract class A { use T { T::__construct as __asconstruct; }}");
} else if ($name == "T") {
eval ("trait T { public function __construct() { } }");
}
return TRUE;
}
class C extends B {
public function __construct() {
}
}
Expected result:
----------------
no error
Actual result:
--------------
[Thu Aug 23 23:34:22 2012] Script: '/home/huixinchen/bug_double_free.phpt'
---------------------------------------
/home/huixinchen/opensource/trunk/Zend/zend_opcode.c(392) : Block 0x2b2c499c8820
status:
Beginning: Cached
Freed (invalid)
Start: OK
End: OK
---------------------------------------
[Thu Aug 23 23:34:22 2012] Script: '/home/huixinchen/bug_double_free.phpt'
Zend/zend_language_scanner.l(1903) : Freeing 0x2B2C499C4AA0 (12 bytes),
script=/home/huixinchen/bug_double_free.phpt
=== Total 1 memory leaks detected ===
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62907&edit=1
Thread (7 messages)