This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/27470] New: [4.1 4.2 regression] wong memory allocator for derived types
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 May 2006 09:41:02 -0000
- Subject: [Bug fortran/27470] New: [4.1 4.2 regression] wong memory allocator for derived types
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code
TYPE foo
INTEGER, DIMENSION(:), POINTER :: array
END TYPE foo
type(foo),allocatable,dimension(:) :: mol
integer :: i, n
n = 10
ALLOCATE (mol(n))
ALLOCATE (mol(1)%array(5))
END
calls _gfortran_allocate_array for the second allocation, which
is wrong and can lead to segfault.
The problem is in gfc_array_allocate, where the check for
expr->symtree->n.sym->attr.allocatable
refers to mol, not to mol(1)%array.
This one is tricky.
--
Summary: [4.1 4.2 regression] wong memory allocator for derived
types
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tkoenig at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27470