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).
This commit is contained in:
Frits van Bommel
2009-05-20 16:20:59 +02:00
parent ea4690128b
commit 95c35225bb
3 changed files with 10 additions and 3 deletions

View File

@@ -1774,7 +1774,7 @@ DValue* AssertExp::toElem(IRState* p)
condty->ty == Tclass &&
!((TypeClass*)condty)->sym->isInterfaceDeclaration())
{
Logger::print("calling class invariant");
Logger::println("calling class invariant");
llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_invariant");
LLValue* arg = DtoBitCast(cond->getRVal(), fn->getFunctionType()->getParamType(0));
gIR->CreateCallOrInvoke(fn, arg);