diff options
author | Ayke van Laethem <[email protected]> | 2022-09-21 17:00:09 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-10-19 22:23:19 +0200 |
commit | f57cffce2d47f7c2b3c9ec1ddd1f077f0830d435 (patch) | |
tree | 316ab792c0442635e3f7cb0facfdee3d9d8bcf9b /interp | |
parent | 7b6a9fab4206bde1a11c3a8d79631a0e8ac71a82 (diff) | |
download | tinygo-f57cffce2d47f7c2b3c9ec1ddd1f077f0830d435.tar.gz tinygo-f57cffce2d47f7c2b3c9ec1ddd1f077f0830d435.zip |
all: add type parameter to *GEP calls
This is necessary for LLVM 15.
Diffstat (limited to 'interp')
-rw-r--r-- | interp/memory.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/interp/memory.go b/interp/memory.go index 3a16b875e..2fa6f5cbc 100644 --- a/interp/memory.go +++ b/interp/memory.go @@ -646,8 +646,8 @@ func (v pointerValue) toLLVMValue(llvmType llvm.Type, mem *memoryView) (llvm.Val if llvmValue.Type() != mem.r.i8ptrType { llvmValue = llvm.ConstBitCast(llvmValue, mem.r.i8ptrType) } - llvmValue = llvm.ConstInBoundsGEP(llvmValue, []llvm.Value{ - llvm.ConstInt(llvmValue.Type().Context().Int32Type(), uint64(v.offset()), false), + llvmValue = llvm.ConstInBoundsGEP(mem.r.mod.Context().Int8Type(), llvmValue, []llvm.Value{ + llvm.ConstInt(mem.r.mod.Context().Int32Type(), uint64(v.offset()), false), }) } |