Skip to content

Commit 3f5e782

Browse files
committed
std.debug: fix FP unwinding for LoongArch
1 parent 98f0bf9 commit 3f5e782

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/std/debug.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,15 +988,15 @@ const StackIterator = union(enum) {
988988
// On RISC-V the frame pointer points to the top of the saved register
989989
// area, on pretty much every other architecture it points to the stack
990990
// slot where the previous frame pointer is saved.
991-
if (native_arch.isRISCV()) break :off -2 * @sizeOf(usize);
991+
if (native_arch.isLoongArch() or native_arch.isRISCV()) break :off -2 * @sizeOf(usize);
992992
// On SPARC the previous frame pointer is stored at 14 slots past %fp+BIAS.
993993
if (native_arch.isSPARC()) break :off 14 * @sizeOf(usize);
994994
break :off 0;
995995
};
996996

997997
/// Offset of the saved return address wrt the frame pointer.
998998
const ra_offset = off: {
999-
if (native_arch.isRISCV()) break :off -1 * @sizeOf(usize);
999+
if (native_arch.isLoongArch() or native_arch.isRISCV()) break :off -1 * @sizeOf(usize);
10001000
if (native_arch.isSPARC()) break :off 15 * @sizeOf(usize);
10011001
if (native_arch.isPowerPC64()) break :off 2 * @sizeOf(usize);
10021002
// On s390x, r14 is the link register and we need to grab it from its customary slot in the

0 commit comments

Comments
 (0)