php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62931 Crash on foreach when using list() => $var
Submitted: 2012-08-25 21:22 UTC Modified: 2012-08-26 04:03 UTC
From: felipe@php.net Assigned: laruence (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: master-Git-2012-08-25 (Git) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: felipe@php.net
New email:
PHP Version: OS:

 

 [2012-08-25 21:22 UTC] felipe@php.net
Description:
------------
I wonder that such syntax is not even supposed to be allowed.

See below.

Test script:
---------------
<?php

foreach ([] as  list() => $x) {
}


Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
0x000000000083af12 in zend_do_end_variable_parse (variable=0x7fffffff8880, type=1, arg_offset=0, tsrm_ls=0x1058090) at /home/felipe/dev/php-src/Zend/zend_compile.c:1303
1303		le = fetch_list_ptr->head;
(gdb) p fetch_list_ptr
$1 = (zend_llist *) 0x0


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-25 21:22 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: laruence
 [2012-08-26 04:03 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7c60aeef857f288661a6f95cf3aa45d6a6feff9b
Log: Fixed bug #62931 &amp; #62932
 [2012-08-26 04:03 UTC] laruence@php.net
-Status: Assigned +Status: Closed
 [2012-08-26 04:03 UTC] laruence@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2013-11-17 09:32 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7c60aeef857f288661a6f95cf3aa45d6a6feff9b
Log: Fixed bug #62931 &amp; #62932
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 12:01:27 2024 UTC