forked from M-Labs/nac3
1
0
Fork 0

core: ndarray_from_ndlist_impl cast size_of to usize

This commit is contained in:
lyken 2024-07-04 12:24:52 +08:00
parent 83154ef8e1
commit d6565feed3
1 changed files with 2 additions and 0 deletions

View File

@ -739,6 +739,8 @@ fn ndarray_from_ndlist_impl<'ctx, G: CodeGenerator + ?Sized>(
_ => { _ => {
let lst_len = src_lst.load_size(ctx, None); let lst_len = src_lst.load_size(ctx, None);
let sizeof_elem = ctx.get_llvm_type(generator, elem_ty).size_of().unwrap(); let sizeof_elem = ctx.get_llvm_type(generator, elem_ty).size_of().unwrap();
let sizeof_elem = ctx.builder.build_int_cast(sizeof_elem, llvm_usize, "").unwrap();
let cpy_len = ctx let cpy_len = ctx
.builder .builder
.build_int_mul( .build_int_mul(