From ca91c52c5a4adcad1eb61c4e7b95a328c22d5ff7 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sat, 29 Nov 2008 17:06:36 +0100 Subject: [PATCH 1/2] Use toParent instead of toParent2 to determine whether inside a function body. --- gen/llvmhelpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index c3664772..7e1ece5d 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -972,7 +972,7 @@ void DtoConstInitGlobal(VarDeclaration* vd) // FIXME: I don't think it's thread safe ... bool doLazyInit = false; - Dsymbol* par = vd->toParent2(); + Dsymbol* par = vd->toParent(); if (par && par->isFuncDeclaration() && vd->init) { From 497c7e87df0731e8ef0577c83fc2a83e65acf642 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sat, 29 Nov 2008 17:13:38 +0100 Subject: [PATCH 2/2] Do put zero in vtable initializer for function without body in abstract class. --- gen/classes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/classes.cpp b/gen/classes.cpp index 656305e4..101615a2 100644 --- a/gen/classes.cpp +++ b/gen/classes.cpp @@ -560,7 +560,7 @@ static void init_class_vtbl_initializer(ClassDeclaration* cd) FuncDeclaration* fd = dsym->isFuncDeclaration(); assert(fd); - if (fd->isAbstract()) + if (fd->isAbstract() || (cd->isAbstract() && !fd->fbody)) { sinits[k] = getNullPtr(getVoidPtrType()); }