| ... | ... | @@ -2094,8 +2094,7 @@ pub const Type = extern union { |
| 2094 | 2094 | .const_slice, |
| 2095 | 2095 | .mut_slice, |
| 2096 | 2096 | => { |
| 2097 | | if (self.elemType().hasCodeGenBits()) return @divExact(target.cpu.arch.ptrBitWidth(), 8) * 2; |
| 2098 | | return @divExact(target.cpu.arch.ptrBitWidth(), 8); |
| 2097 | return @divExact(target.cpu.arch.ptrBitWidth(), 8) * 2; |
| 2099 | 2098 | }, |
| 2100 | 2099 | .const_slice_u8, |
| 2101 | 2100 | .const_slice_u8_sentinel_0, |
| ... | ... | @@ -2114,12 +2113,16 @@ pub const Type = extern union { |
| 2114 | 2113 | .many_mut_pointer, |
| 2115 | 2114 | .c_const_pointer, |
| 2116 | 2115 | .c_mut_pointer, |
| 2117 | | .pointer, |
| 2118 | 2116 | .manyptr_u8, |
| 2119 | 2117 | .manyptr_const_u8, |
| 2120 | 2118 | .manyptr_const_u8_sentinel_0, |
| 2121 | 2119 | => return @divExact(target.cpu.arch.ptrBitWidth(), 8), |
| 2122 | 2120 | |
| 2121 | .pointer => switch (self.castTag(.pointer).?.data.size) { |
| 2122 | .Slice => @divExact(target.cpu.arch.ptrBitWidth(), 8) * 2, |
| 2123 | else => @divExact(target.cpu.arch.ptrBitWidth(), 8), |
| 2124 | }, |
| 2125 | |
| 2123 | 2126 | .c_short => return @divExact(CType.short.sizeInBits(target), 8), |
| 2124 | 2127 | .c_ushort => return @divExact(CType.ushort.sizeInBits(target), 8), |
| 2125 | 2128 | .c_int => return @divExact(CType.int.sizeInBits(target), 8), |
| ... | ... | @@ -2276,13 +2279,8 @@ pub const Type = extern union { |
| 2276 | 2279 | |
| 2277 | 2280 | .const_slice, |
| 2278 | 2281 | .mut_slice, |
| 2279 | | => { |
| 2280 | | if (ty.elemType().hasCodeGenBits()) { |
| 2281 | | return target.cpu.arch.ptrBitWidth() * 2; |
| 2282 | | } else { |
| 2283 | | return target.cpu.arch.ptrBitWidth(); |
| 2284 | | } |
| 2285 | | }, |
| 2282 | => return target.cpu.arch.ptrBitWidth() * 2, |
| 2283 | |
| 2286 | 2284 | .const_slice_u8, |
| 2287 | 2285 | .const_slice_u8_sentinel_0, |
| 2288 | 2286 | => target.cpu.arch.ptrBitWidth() * 2, |
| ... | ... | @@ -2303,7 +2301,6 @@ pub const Type = extern union { |
| 2303 | 2301 | .many_mut_pointer, |
| 2304 | 2302 | .c_const_pointer, |
| 2305 | 2303 | .c_mut_pointer, |
| 2306 | | .pointer, |
| 2307 | 2304 | => { |
| 2308 | 2305 | if (ty.elemType().hasCodeGenBits()) { |
| 2309 | 2306 | return target.cpu.arch.ptrBitWidth(); |
| ... | ... | @@ -2312,6 +2309,11 @@ pub const Type = extern union { |
| 2312 | 2309 | } |
| 2313 | 2310 | }, |
| 2314 | 2311 | |
| 2312 | .pointer => switch (ty.castTag(.pointer).?.data.size) { |
| 2313 | .Slice => target.cpu.arch.ptrBitWidth() * 2, |
| 2314 | else => target.cpu.arch.ptrBitWidth(), |
| 2315 | }, |
| 2316 | |
| 2315 | 2317 | .manyptr_u8, |
| 2316 | 2318 | .manyptr_const_u8, |
| 2317 | 2319 | .manyptr_const_u8_sentinel_0, |