aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-10-14 09:39:15 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2025-10-15 13:59:17 +0200
commitb8dd40fde8aed212ffa8a98b45821ccdf0c2e17d (patch)
tree83eb99de3c864c8e555210db3f7ee5ee4136c16b /lib/std/debug.zig
parent12b1d57df1e0efed6e5a3eb3933de7f08d42d6d5 (diff)
downloadzig-b8dd40fde8aed212ffa8a98b45821ccdf0c2e17d.tar.gz
zig-b8dd40fde8aed212ffa8a98b45821ccdf0c2e17d.zip
std.debug.cpu_context.Sparc: flush register windows in current()
It's better to do this here than in StackIterator.init() so that std.debug.cpu_context.Native.current() isn't a footgun on SPARC.
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index 3f694bec1c..8501df175a 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -807,7 +807,6 @@ const StackIterator = union(enum) {
/// `@frameAddress` and `cpu_context.Native.current` as the caller's stack frame and
/// our own are one and the same.
inline fn init(opt_context_ptr: ?CpuContextPtr) error{CannotUnwindFromContext}!StackIterator {
- flushSparcWindows();
if (opt_context_ptr) |context_ptr| {
if (SelfInfo == void or !SelfInfo.can_unwind) return error.CannotUnwindFromContext;
// Use `di_first` here so we report the PC in the context before unwinding any further.
@@ -826,6 +825,7 @@ const StackIterator = union(enum) {
// in our caller's frame and above.
return .{ .di = .init(&.current()) };
}
+ flushSparcWindows();
return .{ .fp = @frameAddress() };
}
fn deinit(si: *StackIterator) void {