From 0120dd767c038f443c3926e1994737a16297bc8f Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sun, 23 Nov 2008 21:57:11 +0100 Subject: [PATCH] Fix float->bool, #130. Thanks fvbommel. --- gen/llvmhelpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 9b3b722b..ecdd9c0c 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -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);