Bug #62907 [PATCH]: Double free when use traits
Edit report at https://bugs.php.net/bug.php?id=62907&edit=1
ID: 62907
Patch added by: dmitry@php.net
Reported by: laruence@php.net
Summary: Double free when use traits
Status: Assigned
Type: Bug
Package: Scripting Engine problem
PHP Version: 5.4.6
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: alias.diff
Revision: 1346746351
URL: https://bugs.php.net/patch-display.php?bug=62907&patch=alias.diff&revision=1346746351
Previous Comments:
------------------------------------------------------------------------
[2012-08-26 10:33:08] laruence@php.net
Unless we re-implement the whole alias thing, drop the tricky.
we could not fix this properly, even we can do some works in the abstrct methods
copy, but it still in a wrong way.
Dmitry, could you please look at this?
thanks
------------------------------------------------------------------------
[2012-08-23 15:32:28] laruence@php.net
assign to my self.
------------------------------------------------------------------------
[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)