Fixed stack unwind bugs (works!)

This commit is contained in:
2025-03-06 01:22:17 +00:00
parent f197149d80
commit 5aad3e6096
4 changed files with 33 additions and 16 deletions
+5 -2
View File
@@ -27,7 +27,7 @@ pub struct Unwinder {
unwind_ctx: UnwindContext<usize, StoreOnHeap>,
/// The current values of ABI/architecture independent registers. There are
/// used by DWARF.
regs: RegisterSet,
pub regs: RegisterSet,
/// The current CFA address.
cfa: u64,
/// Is this the first iteration?
@@ -112,7 +112,10 @@ impl FallibleIterator for Unwinder {
};
// REVIEWME: Must be a nicer way of doing this.
let pc = pc - 1;
let Some(pc) = pc.checked_sub(1) else {
// REVIEWME: This should handle underflow now.
return Ok(None);
};
self.regs.set_pc(pc);