Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix a regression in the image.vhd test

  • Loading branch information...
commit 66d6e92ca074af9eaa291821f3a0485d63a18040 1 parent 7047e27
@nickg authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/cgen.c
View
4 src/cgen.c
@@ -999,8 +999,10 @@ static LLVMValueRef cgen_fcall(tree_t t, struct cgen_ctx *ctx)
tree_type(tree_param(t, 1).value),
LLVMIntNE, ctx);
else if (icmp(builtin, "image")) {
+ bool is_signed = (type_kind(type_base_recur(arg_type)) == T_INTEGER);
+ LLVMOpcode op = (is_signed ? LLVMSExt : LLVMZExt);
LLVMValueRef iargs[] = {
- LLVMBuildZExtOrBitCast(builder, args[0], LLVMInt64Type(), ""),
+ LLVMBuildCast(builder, op, args[0], LLVMInt64Type(), ""),
llvm_int32(tree_index(tree_param(t, 0).value)),
LLVMBuildPointerCast(builder, mod_name,
LLVMPointerType(LLVMInt8Type(), 0), "")
Please sign in to comment.
Something went wrong with that request. Please try again.