From be651d97b7b4ed78c53b6dd41d11f12036e4ec2a Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Mon, 15 Sep 2008 02:39:55 +0200 Subject: [PATCH] Fixed AddrExp might silently change the type of its value, but we weren't casting to compensate ... why doesn't DMD insert a cast? --- gen/toir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/toir.cpp b/gen/toir.cpp index 8081c2af..71e202fd 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -854,7 +854,7 @@ DValue* AddrExp::toElem(IRState* p) Logger::println("is nothing special"); LLValue* lval = v->getLVal(); Logger::cout() << "lval: " << *lval << '\n'; - return new DImValue(type, v->getLVal()); + return new DImValue(type, DtoBitCast(v->getLVal(), DtoType(type))); } LLConstant* AddrExp::toConstElem(IRState* p)