1
0
forked from M-Labs/nac3

Ptr::copy_from to use SizeT

This commit is contained in:
lyken 2024-08-27 17:31:44 +08:00
parent baf8ee2b3d
commit f167f5f215
No known key found for this signature in database
GPG Key ID: 3BD5FC6AC8325DD8

View File

@ -204,8 +204,8 @@ impl<'ctx, Item: Model<'ctx>> Instance<'ctx, Ptr<Item>> {
) {
// Force extend `num_items` and `itemsize` to `i64` so their types would match.
let itemsize = self.model.size_of(generator, ctx.ctx);
let itemsize = Int(Int64).z_extend_or_truncate(generator, ctx, itemsize);
let num_items = Int(Int64).z_extend_or_truncate(generator, ctx, num_items);
let itemsize = Int(SizeT).z_extend_or_truncate(generator, ctx, itemsize);
let num_items = Int(SizeT).z_extend_or_truncate(generator, ctx, num_items);
let totalsize = itemsize.mul(ctx, num_items);
let is_volatile = ctx.ctx.bool_type().const_zero(); // is_volatile = false