#37144 [Asn->Csd]: PHP crashes trying to assign into property of dide object
| From: | dmitry@php.net | Date: | Wed, 19 Jul 2006 14:05:16 +0000 |
| Subject: | #37144 [Asn->Csd]: PHP crashes trying to assign into property of dide object | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-99605@lists.php.net to get a copy of this message | ||
ID: 37144
Updated by: dmitry@php.net
Reported By: dmitry@php.net
-Status: Assigned
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5.1.2
Assigned To: dmitry
New Comment:
Fixed in CVS HEAD and PHP_5_2.
Previous Comments:
------------------------------------------------------------------------
[2006-04-20 16:58:10] dmitry@php.net
PHP always segfaults with this script if it is compied with
--enable-debug.
------------------------------------------------------------------------
[2006-04-20 13:09:18] smlerman at gmail dot com
I don't get a segfault on Windows 5.1.1, Linux 5.1.1 (compiled on
Ubuntu), or Linux 5.1.2 (compiled on Fedora).
As a side note, should that even be valid syntax? Shouldn't the left
side of assignment only allow variables (other than the special
language construct list())? Isn't foo()->bar[1] an expression, not a
variable?
------------------------------------------------------------------------
[2006-04-20 08:30:53] dmitry@php.net
Description:
------------
PHP removes a temorary object then tryes to assign into its property.
As a result we have SIGSEGV.
Reproduce code:
---------------
<?php
function foo() {
$x = new stdClass();
$x->bar = array(1);
return $x;
}
foo()->bar[1] = "123";
echo "ok\n";
?>
Expected result:
----------------
ok
Actual result:
--------------
crash and/or memory leaks
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37144&edit=1