We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 790f5cd commit 1ca9e1eCopy full SHA for 1ca9e1e
compiler/map.go
@@ -303,9 +303,8 @@ func (b *builder) zeroUndefBytes(typ types.Type, ptr llvm.Value) error {
303
304
for i := 0; i < llvmArrayType.ArrayLength(); i++ {
305
// for each element, first clear any undef bytes in the element itself
306
- offset := b.targetData.ElementOffset(llvmArrayType, i)
307
- llvmOffset := llvm.ConstInt(b.uintptrType, offset, false)
308
- ptr := b.CreateGEP(b.ctx.Int8Type(), base, []llvm.Value{llvmOffset}, "")
+ idx := llvm.ConstInt(b.uintptrType, uint64(i), false)
+ ptr := b.CreateGEP(llvmArrayType, base, []llvm.Value{idx}, "")
309
310
// recursively zero any padding bytes in this element
311
b.zeroUndefBytes(typ.Elem(), ptr)
0 commit comments