| ... | @@ -16575,7 +16575,7 @@ fn analyzePtrArithmetic( | ... | @@ -16575,7 +16575,7 @@ fn analyzePtrArithmetic( |
| 16575 | } | 16575 | } |
| 16576 | // If the addend is not a comptime-known value we can still count on | 16576 | // If the addend is not a comptime-known value we can still count on |
| 16577 | // it being a multiple of the type size. | 16577 | // it being a multiple of the type size. |
| 16578 | const elem_size = Type.fromInterned(ptr_info.child).abiSize(mod); | 16578 | const elem_size = try sema.typeAbiSize(Type.fromInterned(ptr_info.child)); |
| 16579 | const addend = if (opt_off_val) |off_val| a: { | 16579 | const addend = if (opt_off_val) |off_val| a: { |
| 16580 | const off_int = try sema.usizeCast(block, offset_src, try off_val.toUnsignedIntAdvanced(sema)); | 16580 | const off_int = try sema.usizeCast(block, offset_src, try off_val.toUnsignedIntAdvanced(sema)); |
| 16581 | break :a elem_size * off_int; | 16581 | break :a elem_size * off_int; |
| ... | @@ -16612,7 +16612,7 @@ fn analyzePtrArithmetic( | ... | @@ -16612,7 +16612,7 @@ fn analyzePtrArithmetic( |
| 16612 | const offset_int = try sema.usizeCast(block, offset_src, try offset_val.toUnsignedIntAdvanced(sema)); | 16612 | const offset_int = try sema.usizeCast(block, offset_src, try offset_val.toUnsignedIntAdvanced(sema)); |
| 16613 | if (offset_int == 0) return ptr; | 16613 | if (offset_int == 0) return ptr; |
| 16614 | if (try ptr_val.getUnsignedIntAdvanced(mod, sema)) |addr| { | 16614 | if (try ptr_val.getUnsignedIntAdvanced(mod, sema)) |addr| { |
| 16615 | const elem_size = Type.fromInterned(ptr_info.child).abiSize(mod); | 16615 | const elem_size = try sema.typeAbiSize(Type.fromInterned(ptr_info.child)); |
| 16616 | const new_addr = switch (air_tag) { | 16616 | const new_addr = switch (air_tag) { |
| 16617 | .ptr_add => addr + elem_size * offset_int, | 16617 | .ptr_add => addr + elem_size * offset_int, |
| 16618 | .ptr_sub => addr - elem_size * offset_int, | 16618 | .ptr_sub => addr - elem_size * offset_int, |