This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47189] New: [OOP] calling STORAGE_SIZE on a NULL-initialized class pointer
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 6 Jan 2011 13:15:05 +0000
- Subject: [Bug fortran/47189] New: [OOP] calling STORAGE_SIZE on a NULL-initialized class pointer
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47189
Summary: [OOP] calling STORAGE_SIZE on a NULL-initialized class
pointer
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: janus@gcc.gnu.org
Follow-up to PR47180 / PR47024:
type :: t
real(4) :: c
end type
class(t), pointer :: x => null()
print *, storage_size (x)
end
This currently gives a segfault at runtime, because the _vptr component of 'x'
is wrongly initialized to NULL, while it should point to the vtab of the
declared type. If one adds an additional pointer assignment statement
x => null()
everything works fine (due to the fix of PR47180). Only the NULL initialization
still gets it wrong.