aboutsummaryrefslogtreecommitdiffhomepage
path: root/compiler/llvmutil/wordpack.go
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/llvmutil/wordpack.go')
-rw-r--r--compiler/llvmutil/wordpack.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/llvmutil/wordpack.go b/compiler/llvmutil/wordpack.go
index 73b1e27e2..97b860457 100644
--- a/compiler/llvmutil/wordpack.go
+++ b/compiler/llvmutil/wordpack.go
@@ -63,7 +63,7 @@ func EmitPointerPack(builder llvm.Builder, mod llvm.Module, prefix string, needs
}
// Load value (the *i8) from the alloca.
- result := builder.CreateLoad(packedAlloc, "")
+ result := builder.CreateLoad(i8ptrType, packedAlloc, "")
// End the lifetime of the alloca, to help the optimizer.
packedPtr := builder.CreateBitCast(packedAlloc, i8ptrType, "")
@@ -171,7 +171,7 @@ func EmitPointerUnpack(builder llvm.Builder, mod llvm.Module, ptr llvm.Value, va
llvm.ConstInt(ctx.Int32Type(), uint64(i), false),
}
gep := builder.CreateInBoundsGEP(packedAlloc, indices, "")
- values[i] = builder.CreateLoad(gep, "")
+ values[i] = builder.CreateLoad(valueType, gep, "")
}
if !packedRawAlloc.IsNil() {
allocPtr := builder.CreateBitCast(packedRawAlloc, i8ptrType, "")