forked from M-Labs/nac3
array use i64_type().const_int for GEP
This commit is contained in:
parent
d12fb99ded
commit
40aa27c42c
@ -90,7 +90,7 @@ impl<'ctx, Len: ArrayLen, Item: Model<'ctx>> Instance<'ctx, Ptr<Array<Len, Item>
|
|||||||
ctx: &CodeGenContext<'ctx, '_>,
|
ctx: &CodeGenContext<'ctx, '_>,
|
||||||
i: IntValue<'ctx>,
|
i: IntValue<'ctx>,
|
||||||
) -> Instance<'ctx, Ptr<Item>> {
|
) -> Instance<'ctx, Ptr<Item>> {
|
||||||
let zero = ctx.ctx.i32_type().const_zero();
|
let zero = ctx.ctx.i64_type().const_zero();
|
||||||
let ptr = unsafe { ctx.builder.build_in_bounds_gep(self.value, &[zero, i], "").unwrap() };
|
let ptr = unsafe { ctx.builder.build_in_bounds_gep(self.value, &[zero, i], "").unwrap() };
|
||||||
|
|
||||||
unsafe { Ptr(self.model.0.item).believe_value(ptr) }
|
unsafe { Ptr(self.model.0.item).believe_value(ptr) }
|
||||||
@ -104,7 +104,7 @@ impl<'ctx, Len: ArrayLen, Item: Model<'ctx>> Instance<'ctx, Ptr<Array<Len, Item>
|
|||||||
self.model.0.len.length()
|
self.model.0.len.length()
|
||||||
);
|
);
|
||||||
|
|
||||||
let i = ctx.ctx.i32_type().const_int(i, false);
|
let i = ctx.ctx.i64_type().const_int(i, true);
|
||||||
self.gep(ctx, i)
|
self.gep(ctx, i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user