Bug 11203 – extern (C++) classes broken

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-09T01:55:00Z
Last change time
2013-10-10T15:01:08Z
Keywords
pull
Assigned to
nobody
Creator
bugzilla

Comments

Comment #0 by bugzilla — 2013-10-09T01:55:23Z
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.
Comment #1 by code — 2013-10-09T13:25:10Z
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
Comment #2 by github-bugzilla — 2013-10-09T20:14:48Z
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