Fix bug in FP to integer conversion.

This commit is contained in:
Stefano Sanfilippo 2015-03-07 14:11:38 +01:00
parent c9bff1e64b
commit 8d28c5e909

View File

@ -177,7 +177,7 @@ llvm::Value* coerce(BitcodeEmitter::Private *d, llvm::Value *val, llvm::Type *to
}
}
else if (isFP(toType) && isInt(fromType)) {
return d->builder.CreateFPToSI(val, toType);
return d->builder.CreateSIToFP(val, toType);
}
else if (fromType->isFloatTy() && toType->isDoubleTy()) {
return d->builder.CreateFPExt(val, toType);