From d583262c9861dd9c356a7bf8382185d3a8f20dc9 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Tue, 15 Jul 2008 15:16:56 +0200 Subject: [PATCH] [svn r394] Fixed the new DtoNullValue function --- gen/llvmhelpers.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 316b683c..21a7f0e0 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -653,13 +653,13 @@ DValue* DtoNullValue(Type* type) // dynamic array else if (basety == Tarray) { - //TODO: What types do the constants here need to have? - return new DSliceValue(type, NULL, NULL); + LLValue* len = DtoConstSize_t(0); + LLValue* ptr = getNullPtr(getPtrToType(DtoType(basetype->next))); + return new DSliceValue(type, len, ptr); } // delegate else if (basety == Tdelegate) { - //TODO: Is this correct? return new DNullValue(type, LLConstant::getNullValue(lltype)); }