Mercurial > projects > ldc
comparison dmd/declaration.c @ 1401:e2cf1f67ca33
Don't print the entire declaration of the alliassee when `->toChars()` is
called on an `AliasDeclaration`; just printing the name will do. This fixes
#305, which otherwise tries to generate
{{{
class E {
void A() {
alias /* recurse into E->toCBuffer() */ m;
}
}
}}}
by way of an infinite recursion (causing a segfault when the stack runs out).
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Wed, 20 May 2009 16:20:59 +0200 |
parents | 8026319762be |
children | 93644700a0b3 |
comparison
equal
deleted
inserted
replaced
1400:4100c49b753f | 1401:e2cf1f67ca33 |
---|---|
573 #if 0 && _DH | 573 #if 0 && _DH |
574 if (hgs->hdrgen) | 574 if (hgs->hdrgen) |
575 { | 575 { |
576 if (haliassym) | 576 if (haliassym) |
577 { | 577 { |
578 haliassym->toCBuffer(buf, hgs); | 578 buf->writestring(haliassym->toChars()); |
579 buf->writeByte(' '); | 579 buf->writeByte(' '); |
580 buf->writestring(ident->toChars()); | 580 buf->writestring(ident->toChars()); |
581 } | 581 } |
582 else | 582 else |
583 htype->toCBuffer(buf, ident, hgs); | 583 htype->toCBuffer(buf, ident, hgs); |
585 else | 585 else |
586 #endif | 586 #endif |
587 { | 587 { |
588 if (aliassym) | 588 if (aliassym) |
589 { | 589 { |
590 aliassym->toCBuffer(buf, hgs); | 590 buf->writestring(aliassym->toChars()); |
591 buf->writeByte(' '); | 591 buf->writeByte(' '); |
592 buf->writestring(ident->toChars()); | 592 buf->writestring(ident->toChars()); |
593 } | 593 } |
594 else | 594 else |
595 type->toCBuffer(buf, ident, hgs); | 595 type->toCBuffer(buf, ident, hgs); |