[Issue 17936] New: [ICE] compiling some Objective-C code with -lib flag fails
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Oct 25 14:51:03 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=17936
Issue ID: 17936
Summary: [ICE] compiling some Objective-C code with -lib flag
fails
Product: D
Version: D2
Hardware: x86_64
OS: Mac OS X
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: doob at me.com
Compiling the following code:
void alloc()
{
AppDelegate a;
a.alloc();
}
void shared_()
{
NSApplication a;
a.shared_();
}
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.
[1]
https://github.com/dlang/dmd/blob/51bc2fb427a5e0b3701b11ab2b6a5f356d8eca5d/src/ddmd/backend/machobj.c#L2440
--
More information about the Digitalmars-d-bugs
mailing list