Thread overview
[Issue 19699] [2.085.0-beta.2] Obj-C segfault - in objc_glue.getClassName
Feb 25, 2019
Adam D. Ruppe
Feb 25, 2019
Jacob Carlborg
Feb 26, 2019
Dlang Bot
Feb 26, 2019
Dlang Bot
February 25, 2019
https://issues.dlang.org/show_bug.cgi?id=19699

--- Comment #1 from Adam D. Ruppe <destructionator@gmail.com> ---
Here it is:

---
extern(Objective-C)
class Test {
   void foo() {}
}
---


With the second beta, simple `dmd test.d` will trigger the segfault. It seems to not like the function with a body.

--
February 25, 2019
https://issues.dlang.org/show_bug.cgi?id=19699

Jacob Carlborg <doob@me.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |doob@me.com

--- Comment #2 from Jacob Carlborg <doob@me.com> ---
I've found what the problem is. I'll try to make a PR as soon as I can. The actual issue is that there's no base class, in combination with a body for the function. Usually the code will look like this:

extern (Objective-C) class NSObject { ... }
extern (Objective-C) class Test : NSObject { ... }

It's extremely rare to define a new root class in Objective-C.

--
February 26, 2019
https://issues.dlang.org/show_bug.cgi?id=19699

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@jacob-carlborg created dlang/dmd pull request #9390 "Fix issue 19699: Obj-C segfault - in objc_glue.getClassName" fixing this issue:

- Fix issue 19699: Obj-C segfault - in objc_glue.getClassName

  The problem occurs when declaring an Objective-C root class and it
  contains a method with a body.

https://github.com/dlang/dmd/pull/9390

--
February 26, 2019
https://issues.dlang.org/show_bug.cgi?id=19699

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #9390 "Fix issue 19699: Obj-C segfault - in objc_glue.getClassName" was merged into stable:

- 0d61c3a01a37b666ff4354181c57910a77965956 by Jacob Carlborg:
  Fix issue 19699: Obj-C segfault - in objc_glue.getClassName

  The problem occurs when declaring an Objective-C root class and it
  contains a method with a body.

https://github.com/dlang/dmd/pull/9390

--