mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
Fix float->bool, #130. Thanks fvbommel.
This commit is contained in:
parent
ed8199384d
commit
0120dd767c
1 changed files with 1 additions and 1 deletions
|
@ -665,7 +665,7 @@ DValue* DtoCastFloat(Loc& loc, DValue* val, Type* to)
|
||||||
if (totype->ty == Tbool) {
|
if (totype->ty == Tbool) {
|
||||||
rval = val->getRVal();
|
rval = val->getRVal();
|
||||||
LLValue* zero = LLConstant::getNullValue(rval->getType());
|
LLValue* zero = LLConstant::getNullValue(rval->getType());
|
||||||
rval = gIR->ir->CreateFCmpONE(rval, zero, "tmp");
|
rval = gIR->ir->CreateFCmpUNE(rval, zero, "tmp");
|
||||||
}
|
}
|
||||||
else if (totype->iscomplex()) {
|
else if (totype->iscomplex()) {
|
||||||
return DtoComplex(loc, to, val);
|
return DtoComplex(loc, to, val);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue