This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/47189] New: [OOP] calling STORAGE_SIZE on a NULL-initialized class pointer


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]