Changeset View
Changeset View
Standalone View
Standalone View
sys/riscv/riscv/stack_machdep.c
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
stack_zero(st); | stack_zero(st); | ||||
while (1) { | while (1) { | ||||
if ((vm_offset_t)frame->fp < td->td_kstack || | if ((vm_offset_t)frame->fp < td->td_kstack || | ||||
(vm_offset_t)frame->fp >= td->td_kstack + | (vm_offset_t)frame->fp >= td->td_kstack + | ||||
td->td_kstack_pages * PAGE_SIZE) | td->td_kstack_pages * PAGE_SIZE) | ||||
break; | break; | ||||
unwind_frame(frame); | if (unwind_frame(frame) < 0) | ||||
if (!INKERNEL((vm_offset_t)frame->pc)) | |||||
break; | break; | ||||
jrtc27: The error code isn't checked, so now this will keep unwinding. An existing bug as `frame->fp`… | |||||
if (stack_put(st, frame->pc) == -1) | if (stack_put(st, frame->pc) == -1) | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
int | int | ||||
stack_save_td(struct stack *st, struct thread *td) | stack_save_td(struct stack *st, struct thread *td) | ||||
{ | { | ||||
Show All 31 Lines |
The error code isn't checked, so now this will keep unwinding. An existing bug as frame->fp could have been invalid (though presumably the above ad-hoc if is meant to check that up-front?), but made more apparent by this change.