www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17936] New: [ICE] compiling some Objective-C code with -lib


          Issue ID: 17936
           Summary: [ICE] compiling some Objective-C code with -lib flag
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: doob me.com

Compiling the following code:

void alloc()
    AppDelegate a;

void shared_()
    NSApplication a;

extern (Objective-C):

interface NSApplication
    NSApplication shared_()  selector("sharedApplication");

interface AppDelegate
    AppDelegate alloc()  selector("alloc");

With the "-lib" flag (dmd -lib main.d) results in the following error:

Internal error: ddmd/backend/machobj.c 244

The failing line is [1]. It occurs with both DMD 2.071.0 and 2.077.0-beta.2 so
it's probably been like that from the beginning. The Objective-C methods need
to be called and they need to be at least two for the error to occur.


Oct 25 2017