diff --git a/nac3core/src/codegen/irrt/irrt.c b/nac3core/src/codegen/irrt/irrt.c index 1436447b2..a53bf07c0 100644 --- a/nac3core/src/codegen/irrt/irrt.c +++ b/nac3core/src/codegen/irrt/irrt.c @@ -201,7 +201,7 @@ double __nac3_j0(double x) { } uint32_t __nac3_ndarray_calc_size( - const uint64_t *list_data, + const uint32_t *list_data, uint32_t list_len, uint32_t begin_idx, uint32_t end_idx @@ -210,7 +210,7 @@ uint32_t __nac3_ndarray_calc_size( uint32_t num_elems = 1; for (uint32_t i = begin_idx; i < end_idx; ++i) { - uint64_t val = list_data[i]; + uint32_t val = list_data[i]; __builtin_assume(val > 0); num_elems *= val; } diff --git a/nac3core/src/codegen/irrt/mod.rs b/nac3core/src/codegen/irrt/mod.rs index 8677f085c..8bab98543 100644 --- a/nac3core/src/codegen/irrt/mod.rs +++ b/nac3core/src/codegen/irrt/mod.rs @@ -579,10 +579,8 @@ where G: CodeGenerator + ?Sized, Dims: ArrayLikeIndexer<'ctx>, { - let llvm_i64 = ctx.ctx.i64_type(); let llvm_usize = generator.get_size_type(ctx.ctx); - - let llvm_pi64 = llvm_i64.ptr_type(AddressSpace::default()); + let llvm_pusize = llvm_usize.ptr_type(AddressSpace::default()); let ndarray_calc_size_fn_name = match llvm_usize.get_bit_width() { 32 => "__nac3_ndarray_calc_size", @@ -590,7 +588,7 @@ where bw => unreachable!("Unsupported size type bit width: {}", bw), }; let ndarray_calc_size_fn_t = llvm_usize.fn_type( - &[llvm_pi64.into(), llvm_usize.into(), llvm_usize.into(), llvm_usize.into()], + &[llvm_pusize.into(), llvm_usize.into(), llvm_usize.into(), llvm_usize.into()], false, ); let ndarray_calc_size_fn =