Bug 24547 – Stack overflow in CppMangleVisitor.writeQualified

Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2024-05-10T17:31:25Z
Last change time
2024-12-13T19:35:13Z
Keywords
C++
Assigned to
No Owner
Creator
Tim
Moved to GitHub: dmd#20454 →

Comments

Comment #0 by tim.dlang — 2024-05-10T17:31:25Z
DMD crashes when compiling the following code: ``` extern(C++): struct S(bool defined) { enum DefinedType { Defined } } void f(T)(S!(true).DefinedType = S!(true).DefinedType.Defined) { } void main() { f!(int)(); } ``` A gdb backtrace repeats the following three lines: ``` #50 0x0000555555952ab7 in CppMangleVisitor::visit(TemplateInstance*) (this=0x7fffffffb848, t=0x7ffff789a8a0) at src/dmd/cppmangle.d:2095 #51 0x00005555559d6f8e in TemplateInstance::accept(Visitor*) (this=0x7ffff789a8a0, v=0x7fffffffb848) at src/dmd/dtemplate.d:5496 #52 0x0000555555951b67 in _D3dmd9cppmangle16CppMangleVisitor14writeQualifiedMFCQBz9dtemplate16TemplateInstanceMDFZvZv (this=0x7fffffffb848, dg=..., t=0x7ffff789a8a0) at src/dmd/cppmangle.d:1671 ``` According to run.dlang.org it compiled until 2.083.1 and DMD crashes since 2.084.1, but I did not check if the mangling was correct, when it compiled.
Comment #1 by robert.schadek — 2024-12-13T19:35:13Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20454 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB