public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/27470]  New: [4.1 4.2 regression] wong memory allocator for derived types
@ 2006-05-07  9:41 tkoenig at gcc dot gnu dot org
  2006-05-07 17:31 ` [Bug fortran/27470] [4.1/4.2 " pinskia at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2006-05-07  9:41 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-06-28 18:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-07  9:41 [Bug fortran/27470] New: [4.1 4.2 regression] wong memory allocator for derived types tkoenig at gcc dot gnu dot org
2006-05-07 17:31 ` [Bug fortran/27470] [4.1/4.2 " pinskia at gcc dot gnu dot org
2006-05-07 19:36 ` tkoenig at gcc dot gnu dot org
2006-05-08 21:06 ` [Bug fortran/27470] [4.1/4.2 regression] wrong " tkoenig at gcc dot gnu dot org
2006-05-08 22:00 ` tkoenig at gcc dot gnu dot org
2006-05-08 22:11 ` tkoenig at gcc dot gnu dot org
2006-05-10 18:27 ` tkoenig at gcc dot gnu dot org
2006-05-14 22:35 ` mmitchel at gcc dot gnu dot org
2006-05-15 19:39 ` patchapp at dberlin dot org
2006-05-25  2:47 ` [Bug fortran/27470] [4.1 " mmitchel at gcc dot gnu dot org
2006-05-27 21:25 ` tkoenig at gcc dot gnu dot org
2006-05-28 12:33 ` tkoenig at gcc dot gnu dot org
2006-05-28 20:36 ` tkoenig at gcc dot gnu dot org
2006-05-28 20:37 ` tkoenig at gcc dot gnu dot org
2006-06-28 18:50 ` jjcogliati-r1 at yahoo dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).