mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-27 17:13:20 +01:00
Fix float->bool, #130. Thanks fvbommel.
This commit is contained in:
@@ -665,7 +665,7 @@ DValue* DtoCastFloat(Loc& loc, DValue* val, Type* to)
|
||||
if (totype->ty == Tbool) {
|
||||
rval = val->getRVal();
|
||||
LLValue* zero = LLConstant::getNullValue(rval->getType());
|
||||
rval = gIR->ir->CreateFCmpONE(rval, zero, "tmp");
|
||||
rval = gIR->ir->CreateFCmpUNE(rval, zero, "tmp");
|
||||
}
|
||||
else if (totype->iscomplex()) {
|
||||
return DtoComplex(loc, to, val);
|
||||
|
||||
Reference in New Issue
Block a user