Fixed stack unwind bugs (works!)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user