Bug 17936 – [ICE] compiling some Objective-C code with -lib flag fails

Status
NEW
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2017-10-25T14:51:03Z
Last change time
2024-12-13T18:55:01Z
Keywords
ice, objc
Assigned to
No Owner
Creator
Jacob Carlborg
Moved to GitHub: dmd#19331 →

Comments

Comment #0 by doob — 2017-10-25T14:51:03Z
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
Comment #1 by robert.schadek — 2024-12-13T18:55:01Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19331 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB