From 8ead24a2bb2e6ca64ca3e15cadc356d1f5c3cca5 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sun, 13 Oct 2013 05:48:27 +0200 Subject: [PATCH] Handle typeof(null) -> Object conversion. Not sure why this wasn't triggered by the test suite before. --- gen/llvmhelpers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 14cf1f8d..a33b16ce 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -737,10 +737,10 @@ DValue* DtoCastNull(Loc& loc, DValue* val, Type* to) Type* totype = to->toBasetype(); LLType* tolltype = DtoType(to); - if (totype->ty == Tpointer) + if (totype->ty == Tpointer || totype->ty == Tclass) { if (Logger::enabled()) - Logger::cout() << "cast null to pointer: " << *tolltype << '\n'; + Logger::cout() << "cast null to pointer/class: " << *tolltype << '\n'; LLValue *rval = DtoBitCast(val->getRVal(), tolltype); return new DImValue(to, rval); }