From 0251a1e7208fe72a3f616c0a6e93e8f9a3feed60 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Sat, 2 Aug 2008 01:23:53 +0200 Subject: [PATCH] Fixed regressions --- gen/llvmhelpers.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index f8d24654..ac389ce9 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -485,6 +485,12 @@ LLValue* DtoNestedVariable(VarDeclaration* vd) LLValue* ptr = DtoNestedContext(func); assert(ptr && "nested var, but no context"); + // if there is no nestedVar the context itself is what we're after + if (!func->ir.irFunc->nestedVar) + { + return ptr; + } + // handle a "normal" nested variable // we must cast here to be sure. nested classes just have a void*