From 8bbf6ab984efd7b8b01264f504fb497c37a30ada Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Fri, 26 Jun 2009 17:18:36 +0200 Subject: [PATCH] Treat ConditionalDeclarations correctly in DtoDeclarationExp. Fixes #332. --- gen/llvmhelpers.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 502884b5..fa4da945 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -979,10 +979,12 @@ DValue* DtoDeclarationExp(Dsymbol* declaration) else if (AttribDeclaration* a = declaration->isAttribDeclaration()) { Logger::println("AttribDeclaration"); - if (a->decl) - for (int i=0; i < a->decl->dim; ++i) + // choose the right set in case this is a conditional declaration + Array *d = a->include(NULL, NULL); + if (d) + for (int i=0; i < d->dim; ++i) { - DtoDeclarationExp((Dsymbol*)a->decl->data[i]); + DtoDeclarationExp((Dsymbol*)d->data[i]); } } // mixin declaration