www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11203] New: extern (C++) classes broken

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11203

           Summary: extern (C++) classes broken
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bugzilla digitalmars.com


--- Comment #0 from Walter Bright <bugzilla digitalmars.com> 2013-10-09
01:55:23 PDT ---
The following code:

---------------
extern(C++) class C1687 {
    void func() {}
}

void test1687() {
    auto c = new C1687();
}
--------------

randomly fails at runtime because the class' .init data is all goofed up. The
size for it is correct, but the actual data is not.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 09 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11203


Martin Nowak <code dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |code dawg.eu


--- Comment #1 from Martin Nowak <code dawg.eu> 2013-10-09 13:25:10 PDT ---
The init data is fine, C++ classes are now allocated by the GC, but there was a
bug that caused the GC to finalize them, even though they don't have a
classinfo ptr.
https://github.com/D-Programming-Language/druntime/pull/633

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 09 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11203



--- Comment #2 from github-bugzilla puremagic.com 2013-10-09 20:14:48 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/526629d21dd6defa43c8ad95541e52d5f51eaf47
fix Issue 11203

- fixup #614 - disable finalization for extern(C++) classes

- BlkAttr is already default initialized to BlkAttr.FINALIZE
  so we have to clear the bit for C++ classes.

https://github.com/D-Programming-Language/druntime/commit/8bb49c5e184dec6479dc99dfaa61613594f80bda
Merge pull request #633 from dawgfoto/fix11203

fix Issue 11203

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 09 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11203


Walter Bright <bugzilla digitalmars.com> changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 10 2013