mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-09-30 09:10:19 +02:00
Get rid of DtoBoolean - use DtoCast(... Type::tbool) instead.
Fixed some casts to bool that were using truncation.
This commit is contained in:
@@ -945,6 +945,12 @@ DValue* DtoCastArray(Loc& loc, DValue* u, Type* to)
|
||||
Logger::cout() << "to sarray" << '\n';
|
||||
assert(0);
|
||||
}
|
||||
else if (totype->ty == Tbool) {
|
||||
// return (arr.ptr !is null)
|
||||
LLValue* ptr = DtoArrayPtr(u);
|
||||
LLConstant* nul = getNullPtr(ptr->getType());
|
||||
rval = gIR->ir->CreateICmpNE(ptr, nul, "tmp");
|
||||
}
|
||||
else {
|
||||
assert(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user