From 2d58363c5079ee64d22ea781e59a6a7dfc82ea4a Mon Sep 17 00:00:00 2001 From: Stefano Sanfilippo Date: Mon, 9 Mar 2015 14:26:25 +0100 Subject: [PATCH] Ext or trunc for integers types, not bitcast. --- BitcodeEmitter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BitcodeEmitter.cpp b/BitcodeEmitter.cpp index 80c31be..168b150 100644 --- a/BitcodeEmitter.cpp +++ b/BitcodeEmitter.cpp @@ -186,7 +186,7 @@ llvm::Value* coerce(BitcodeEmitter::Private *d, llvm::Value *val, llvm::Type *to if (isFP(fromType)) { return d->builder.CreateFPToSI(val, toType); } else if (isInt(fromType)) { - return d->builder.CreateSExtOrBitCast(val, toType); + return d->builder.CreateSExtOrTrunc(val, toType); } } else if (isFP(toType) && isInt(fromType)) {