| ... | ... | @@ -10475,11 +10475,14 @@ pub const FuncGen = struct { |
| 10475 | 10475 | const slice_ty = self.typeOfIndex(inst); |
| 10476 | 10476 | const slice_llvm_ty = try o.lowerType(pt, slice_ty); |
| 10477 | 10477 | |
| 10478 | // If operand is small (e.g. `u8`), then signedness becomes a problem -- GEP always treats the index as signed. |
| 10479 | const extended_operand = try self.wip.conv(.unsigned, operand, try o.lowerType(pt, .usize), ""); |
| 10480 | |
| 10478 | 10481 | const error_name_table_ptr = try self.getErrorNameTable(); |
| 10479 | 10482 | const error_name_table = |
| 10480 | 10483 | try self.wip.load(.normal, .ptr, error_name_table_ptr.toValue(&o.builder), .default, ""); |
| 10481 | 10484 | const error_name_ptr = |
| 10482 | | try self.wip.gep(.inbounds, slice_llvm_ty, error_name_table, &.{operand}, ""); |
| 10485 | try self.wip.gep(.inbounds, slice_llvm_ty, error_name_table, &.{extended_operand}, ""); |
| 10483 | 10486 | return self.wip.load(.normal, slice_llvm_ty, error_name_ptr, .default, ""); |
| 10484 | 10487 | } |
| 10485 | 10488 | |
| ... | ... | @@ -12774,7 +12777,7 @@ fn isByRef(ty: Type, zcu: *Zcu) bool { |
| 12774 | 12777 | }, |
| 12775 | 12778 | .@"union" => switch (ty.containerLayout(zcu)) { |
| 12776 | 12779 | .@"packed" => return false, |
| 12777 | | else => return ty.hasRuntimeBits(zcu), |
| 12780 | else => return ty.hasRuntimeBits(zcu) and !ty.unionHasAllZeroBitFieldTypes(zcu), |
| 12778 | 12781 | }, |
| 12779 | 12782 | .error_union => { |
| 12780 | 12783 | const payload_ty = ty.errorUnionPayload(zcu); |