Fix float->bool, #130. Thanks fvbommel.

This commit is contained in:
Christian Kamm 2008-11-23 21:57:11 +01:00
parent ed8199384d
commit 0120dd767c

View file

@ -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);