mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 09:10:22 +02:00
fix stack corruption on vm-save-stack; more robust with nonlocal exits
* module/system/repl/command.scm: Coerce rationals to floats. * module/system/vm/program.scm (program-documentation): Fix a typo, doh! * src/vm.c (vm_reset_stack, struct vm_unwind_data): Add unwind handler to reset vp->sp, vp->fp, and vp->this_frame when performing a nonlocal exit from a vm_run. (vm_heapify_frames_1): Don't repack the stack, it causes stack corruption. I think we need spaghetti stacks to handle continuations, not separate heap frames. I don't think call/cc is working now. (vm-save-stack): Don't call heapify_frames, that modifies the stack that we're copying. Instead call its helper, heapify_1. * src/vm_engine.c (vm_run): Set up the vm_reset_stack unwind handler. * src/vm_engine.h (IP_REG, SP_REG, FP_REG): If we got through all of the checks without having these macros defined, define them as empty. Happens on x86-64. * src/vm_system.c (halt): End the dynwind before we return from the VM. * src/vm_scheme.c (REL): Sync the regs before calling scm_lt_p et al, cause they can do a nonlocal exit.
This commit is contained in:
parent
68a2e18a04
commit
17d1b4bffd
7 changed files with 56 additions and 5 deletions
|
@ -301,7 +301,7 @@ Time execution."
|
|||
(gc-end (gc-run-time))
|
||||
(vms-end (vm-stats (repl-vm repl))))
|
||||
(define (get proc start end)
|
||||
(/ (- (proc end) (proc start)) internal-time-units-per-second))
|
||||
(exact->inexact (/ (- (proc end) (proc start)) internal-time-units-per-second)))
|
||||
(repl-print repl result)
|
||||
(display "clock utime stime cutime cstime gctime\n")
|
||||
(format #t "~5,2F ~5,2F ~5,2F ~6,2F ~6,2F ~6,2F\n"
|
||||
|
|
|
@ -59,5 +59,5 @@
|
|||
(assq-ref (program-properties proc) prop))
|
||||
|
||||
(define (program-documentation prog)
|
||||
(assq-ref (program-properties proc) 'documentation))
|
||||
(assq-ref (program-properties prog) 'documentation))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue