Bug 18093 – [Reg 2.071] MSCOFF: dmd crashes when overriding a C++ method in a mixin template

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2017-12-17T09:51:27Z
Last change time
2018-01-08T21:28:43Z
Keywords
ice, pull
Assigned to
No Owner
Creator
Rainer Schuetze

Comments

Comment #0 by r.sagitario — 2017-12-17T09:51:27Z
When building dmd itself with -m64 or -m32mscoff on windows, dmd crashes, current master with this stack trace: DMD v2.077.1 DEBUG object.Error@(0): Access Violation ---------------- 0x00494DA6 in FuncDeclaration at c:\s\d\rainers\dmd\src\dmd\func.d(618) 0x004579F5 in DsymbolSemanticVisitor at c:\s\d\rainers\dmd\src\dmd\dsymbolsem.d(4512) 0x0045864E in DsymbolSemanticVisitor at c:\s\d\rainers\dmd\src\dmd\dsymbolsem.d(4858) 0x00497DA9 in FuncDeclaration at c:\s\d\rainers\dmd\src\dmd\func.d(2276) ... It builds just fine with -m32. Dustmite reduces this to ////////////////////////////////// struct ASTCodegen {} extern (C++) class ParseTimeVisitor(AST) { void visit() {} } template ParseVisitMethods(AST) { override void visit() {} } class GenericTransitiveVisitor(AST) : ParseTimeVisitor!AST { mixin ParseVisitMethods!AST; } alias SemanticTimeTransitiveVisitor = GenericTransitiveVisitor!ASTCodegen; ////////////////////////////////// This crashes starting with dmd 2.071, but produces a correct error message about mismatched override (as -m32 does for all versions). Adding extern(C++) to the override method in ParseVisitMethods makes it compile in all versions and targets.
Comment #1 by r.sagitario — 2017-12-17T10:32:39Z
Comment #2 by github-bugzilla — 2017-12-21T06:58:28Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/be86e9d171887573ae9a77f2c84f42c6e964daab fix issue 18093: [Reg 2.071] MSCOFF: dmd crashes when overriding a C++ method in a mixin template https://github.com/dlang/dmd/commit/86e66c5a65ac08c337e8f9e429e16b5706b1acea Merge pull request #7455 from rainers/issue18093 fix issue 18093: [Reg 2.071] MSCOFF: dmd crashes when overriding a C+… merged-on-behalf-of: Walter Bright <[email protected]>
Comment #3 by github-bugzilla — 2017-12-21T09:35:26Z
Commit pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/691aa65e81ce626b63ef7a5e75cfbdce07c8b411 fix issue 18093: [Reg 2.071] MSCOFF: dmd crashes when overriding a C++ method in a mixin template
Comment #4 by github-bugzilla — 2017-12-30T03:03:53Z
Commit pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/691aa65e81ce626b63ef7a5e75cfbdce07c8b411 fix issue 18093: [Reg 2.071] MSCOFF: dmd crashes when overriding a C++ method in a mixin template
Comment #5 by github-bugzilla — 2018-01-08T21:28:43Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/f3a40a9705b0f96b6be4308c74c143faf6295dac Revise the fix for issue #18093 Make sure to skip over template mixin parents etc., all the way up to the containing class, instead of returning null if the immediate parent isn't a class. https://github.com/dlang/dmd/commit/b9c345406a4a17f972fdf66bd1c052238dab5290 Merge pull request #7642 from kinke/func [Trivial] Revise the fix for issue #18093 merged-on-behalf-of: Walter Bright <[email protected]>