Summary: Compiler causes stack overflow with recursive typedef
                    and option -g
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Rainer Schuetze <> 2012-09-15 05:19:38 
PDT ---
The file fail4.d from the dmd test suite causes a stack overflow when
generating debug information at the same time. The code is

typedef foo bar;
typedef bar foo;

Without "-g" on the command line, dmd reports:
test.d(3): Error: typedef circular definition

If dmd is compiled with the Microsoft compiler instead of dmc, this function

type *TypeTypedef::toCtype()
    return sym->basetype->toCtype();

in toctype.c is tail recursion optimized, which results in a freeze.

The problem does not happen with "alias", because the recursion is dealt with
in the front end:

test.d(2): Error: alias recursive alias declaration

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to