Mercurial > projects > ldc
diff gen/arrays.cpp @ 193:aca17e55b7a5 trunk
[svn r209] Fixed: exotic array to pointer casts were broken.
Changed: classes now have opaque vtables.
author | lindquist |
---|---|
date | Mon, 12 May 2008 18:44:11 +0200 |
parents | 6526cf5bb2be |
children | e881c9b1c738 |
line wrap: on
line diff
--- a/gen/arrays.cpp Mon May 12 18:22:55 2008 +0200 +++ b/gen/arrays.cpp Mon May 12 18:44:11 2008 +0200 @@ -934,10 +934,9 @@ Logger::cout() << "from array or sarray" << '\n'; if (totype->ty == Tpointer) { Logger::cout() << "to pointer" << '\n'; - assert(fromtype->next == totype->next || totype->next->ty == Tvoid); rval = DtoArrayPtr(u); - if (fromtype->next != totype->next) - rval = gIR->ir->CreateBitCast(rval, getPtrToType(llvm::Type::Int8Ty), "tmp"); + if (rval->getType() != tolltype) + rval = gIR->ir->CreateBitCast(rval, tolltype, "tmp"); } else if (totype->ty == Tarray) { Logger::cout() << "to array" << '\n';