[Issue 20719] New: Self struct definition causes stack overflow

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 3 19:28:22 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20719

          Issue ID: 20719
           Summary: Self struct definition causes stack overflow
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ben.james.jones at gmail.com

Trigger:

import sumtype;
struct A{}

struct B {

  SumType!(This, A)[] elems;
}


relevant piece of the dmd stacktrace.  isTypeIsolated calls itself recursively
until the stack overflows. 

 frame #130408: 0x0000000100152626
dmd`_D3dmd4func15FuncDeclaration14isTypeIsolatedMFCQBt5mtype4TypeZb + 254
    frame #130409: 0x000000010004e13d
dmd`implicitConvTo::ImplicitConvTo::visit(CallExp*) + 149
    frame #130410: 0x000000010011960a dmd`CallExp::accept(Visitor*) + 34
    frame #130411: 0x000000010004ccaa
dmd`_D3dmd5dcast14implicitConvToFCQBc10expression10ExpressionCQCe5mtype4TypeZEQCu7globals5MATCH
+ 74
    frame #130412: 0x000000010021be40
dmd`_D3dmd5mtype12TypeFunction9callMatchMFCQBlQBk4TypeACQBy10expression10ExpressioniPPxaPSQDg6dscope5ScopeZEQDy7globals5MATCH
+ 1744

--


More information about the Digitalmars-d-bugs mailing list