mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-12 05:47:11 +03:00
[svn r209] Fixed: exotic array to pointer casts were broken.
Changed: classes now have opaque vtables.
This commit is contained in:
parent
7c78e3665b
commit
9f3be435b0
11 changed files with 129 additions and 48 deletions
|
@ -934,10 +934,9 @@ DValue* DtoCastArray(DValue* u, Type* to)
|
|||
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';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue