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 objc/47077] New: ICE on invalid code (method implementation outside of implementation context)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47077

           Summary: ICE on invalid code (method implementation outside of
                    implementation context)
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: objc
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nicola@gcc.gnu.org


Here is a minimal testcase --

- (int) method: (int)argument
{
  return argument;
}

The crash is due to the fact that, when we find a method outside an
implementation context, we don't even create a function context.  So, all the
code in the method will be parsed in a void and crash the compiler at the first
reference to the local bind or such like.

We most likely ought to review the code start/closing the method, and if the
method is outside of an implementation context, start/close it normally but
without associating it with a class.  I suppose 'self' could be set to be of
type 'id'.

Thanks


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