Skip to content

Commit 790f5cd

Browse files
committed
compiler: use llvm array length
1 parent 67e4a39 commit 790f5cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/map.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,9 @@ func (b *builder) zeroUndefBytes(typ types.Type, ptr llvm.Value) error {
301301
// - padding within each element
302302
// - padding between elements
303303

304-
for i := uint64(0); i < uint64(typ.Len()); i++ {
304+
for i := 0; i < llvmArrayType.ArrayLength(); i++ {
305305
// for each element, first clear any undef bytes in the element itself
306-
offset := b.targetData.ElementOffset(llvmArrayType, int(i))
306+
offset := b.targetData.ElementOffset(llvmArrayType, i)
307307
llvmOffset := llvm.ConstInt(b.uintptrType, offset, false)
308308
ptr := b.CreateGEP(b.ctx.Int8Type(), base, []llvm.Value{llvmOffset}, "")
309309

0 commit comments

Comments
 (0)