Update List.getUnsafe to use wrapper

This commit is contained in:
Richard Feldman 2020-03-10 02:51:54 -04:00
parent 8c43c66aa3
commit 6f64bb2f9b

View file

@ -646,8 +646,7 @@ fn call_with_args<'a, 'ctx, 'env>(
// TODO here, check to see if the requested index exceeds the length of the array. // TODO here, check to see if the requested index exceeds the length of the array.
// Slot 0 in the tuple struct is the pointer to the array data // Slot 0 in the tuple struct is the pointer to the array data
let array_ptr_field = builder.build_extract_value(tuple_struct, 1, "unwrapped_list_len").unwrap().into_pointer_value(); let array_data_ptr = builder.build_extract_value(tuple_struct, 0, "unwrapped_list_ptr").unwrap().into_pointer_value();
let array_data_ptr = builder.build_load(array_ptr_field, "get_array_data").into_pointer_value();
let elem_bytes = 8; // TODO Look this size up instead of hardcoding it! let elem_bytes = 8; // TODO Look this size up instead of hardcoding it!
let elem_size = env.context.i64_type().const_int(elem_bytes, false); let elem_size = env.context.i64_type().const_int(elem_bytes, false);