| ... | @@ -833,6 +833,10 @@ pub const PanicCause = union(enum) { | ... | @@ -833,6 +833,10 @@ pub const PanicCause = union(enum) { |
| 833 | | 833 | |
| 834 | pub fn panicSentinelMismatch(expected: anytype, found: @TypeOf(expected)) noreturn { | 834 | pub fn panicSentinelMismatch(expected: anytype, found: @TypeOf(expected)) noreturn { |
| 835 | @branchHint(.cold); | 835 | @branchHint(.cold); |
| | 836 | if (builtin.zig_backend == .stage2_riscv64) { |
| | 837 | // https://github.com/ziglang/zig/issues/21519 |
| | 838 | @trap(); |
| | 839 | } |
| 836 | switch (@typeInfo(@TypeOf(expected))) { | 840 | switch (@typeInfo(@TypeOf(expected))) { |
| 837 | .int => |int| switch (int.signedness) { | 841 | .int => |int| switch (int.signedness) { |
| 838 | .unsigned => if (int.bits <= @bitSizeOf(usize)) panic(.{ .sentinel_mismatch_usize = .{ | 842 | .unsigned => if (int.bits <= @bitSizeOf(usize)) panic(.{ .sentinel_mismatch_usize = .{ |
| ... | @@ -864,11 +868,19 @@ pub fn panicSentinelMismatch(expected: anytype, found: @TypeOf(expected)) noretu | ... | @@ -864,11 +868,19 @@ pub fn panicSentinelMismatch(expected: anytype, found: @TypeOf(expected)) noretu |
| 864 | | 868 | |
| 865 | pub fn panicUnwrapError(ert: ?*StackTrace, err: anyerror) noreturn { | 869 | pub fn panicUnwrapError(ert: ?*StackTrace, err: anyerror) noreturn { |
| 866 | @branchHint(.cold); | 870 | @branchHint(.cold); |
| | 871 | if (builtin.zig_backend == .stage2_riscv64) { |
| | 872 | // https://github.com/ziglang/zig/issues/21519 |
| | 873 | @trap(); |
| | 874 | } |
| 867 | panic(.{ .unwrap_error = err }, ert, @returnAddress()); | 875 | panic(.{ .unwrap_error = err }, ert, @returnAddress()); |
| 868 | } | 876 | } |
| 869 | | 877 | |
| 870 | pub fn panicOutOfBounds(index: usize, len: usize) noreturn { | 878 | pub fn panicOutOfBounds(index: usize, len: usize) noreturn { |
| 871 | @branchHint(.cold); | 879 | @branchHint(.cold); |
| | 880 | if (builtin.zig_backend == .stage2_riscv64) { |
| | 881 | // https://github.com/ziglang/zig/issues/21519 |
| | 882 | @trap(); |
| | 883 | } |
| 872 | panic(.{ .index_out_of_bounds = .{ | 884 | panic(.{ .index_out_of_bounds = .{ |
| 873 | .index = index, | 885 | .index = index, |
| 874 | .len = len, | 886 | .len = len, |
| ... | @@ -877,6 +889,10 @@ pub fn panicOutOfBounds(index: usize, len: usize) noreturn { | ... | @@ -877,6 +889,10 @@ pub fn panicOutOfBounds(index: usize, len: usize) noreturn { |
| 877 | | 889 | |
| 878 | pub fn panicStartGreaterThanEnd(start: usize, end: usize) noreturn { | 890 | pub fn panicStartGreaterThanEnd(start: usize, end: usize) noreturn { |
| 879 | @branchHint(.cold); | 891 | @branchHint(.cold); |
| | 892 | if (builtin.zig_backend == .stage2_riscv64) { |
| | 893 | // https://github.com/ziglang/zig/issues/21519 |
| | 894 | @trap(); |
| | 895 | } |
| 880 | panic(.{ .start_index_greater_than_end = .{ | 896 | panic(.{ .start_index_greater_than_end = .{ |
| 881 | .start = start, | 897 | .start = start, |
| 882 | .end = end, | 898 | .end = end, |
| ... | @@ -885,6 +901,10 @@ pub fn panicStartGreaterThanEnd(start: usize, end: usize) noreturn { | ... | @@ -885,6 +901,10 @@ pub fn panicStartGreaterThanEnd(start: usize, end: usize) noreturn { |
| 885 | | 901 | |
| 886 | pub fn panicInactiveUnionField(active: anytype, accessed: @TypeOf(active)) noreturn { | 902 | pub fn panicInactiveUnionField(active: anytype, accessed: @TypeOf(active)) noreturn { |
| 887 | @branchHint(.cold); | 903 | @branchHint(.cold); |
| | 904 | if (builtin.zig_backend == .stage2_riscv64) { |
| | 905 | // https://github.com/ziglang/zig/issues/21519 |
| | 906 | @trap(); |
| | 907 | } |
| 888 | panic(.{ .inactive_union_field = .{ | 908 | panic(.{ .inactive_union_field = .{ |
| 889 | .active = @tagName(active), | 909 | .active = @tagName(active), |
| 890 | .accessed = @tagName(accessed), | 910 | .accessed = @tagName(accessed), |