diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-10-09 20:42:54 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-10-09 20:43:32 +0200 |
| commit | 3f5e782357bbd89e604ff8ba214eb41fe56c8ff7 (patch) | |
| tree | f0765de5b5a7c82f52738788914baecc5a709074 /lib/std | |
| parent | 98f0bf9b67abc0fc2f787df95c26c75dc6db3c88 (diff) | |
| download | zig-3f5e782357bbd89e604ff8ba214eb41fe56c8ff7.tar.gz zig-3f5e782357bbd89e604ff8ba214eb41fe56c8ff7.zip | |
std.debug: fix FP unwinding for LoongArch
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/debug.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 51303b68dd..5048d9c656 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -988,7 +988,7 @@ const StackIterator = union(enum) { // On RISC-V the frame pointer points to the top of the saved register // area, on pretty much every other architecture it points to the stack // slot where the previous frame pointer is saved. - if (native_arch.isRISCV()) break :off -2 * @sizeOf(usize); + if (native_arch.isLoongArch() or native_arch.isRISCV()) break :off -2 * @sizeOf(usize); // On SPARC the previous frame pointer is stored at 14 slots past %fp+BIAS. if (native_arch.isSPARC()) break :off 14 * @sizeOf(usize); break :off 0; @@ -996,7 +996,7 @@ const StackIterator = union(enum) { /// Offset of the saved return address wrt the frame pointer. const ra_offset = off: { - if (native_arch.isRISCV()) break :off -1 * @sizeOf(usize); + if (native_arch.isLoongArch() or native_arch.isRISCV()) break :off -1 * @sizeOf(usize); if (native_arch.isSPARC()) break :off 15 * @sizeOf(usize); if (native_arch.isPowerPC64()) break :off 2 * @sizeOf(usize); // On s390x, r14 is the link register and we need to grab it from its customary slot in the |
