summaryrefslogtreecommitdiff
path: root/module/system/repl/error-handling.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/system/repl/error-handling.scm')
-rw-r--r--module/system/repl/error-handling.scm22
1 files changed, 13 insertions, 9 deletions
diff --git a/module/system/repl/error-handling.scm b/module/system/repl/error-handling.scm
index d7d43bd71..28b542830 100644
--- a/module/system/repl/error-handling.scm
+++ b/module/system/repl/error-handling.scm
@@ -88,15 +88,19 @@
(format #t " or `,q' to return to the old prompt.\n")
(let ((debug
(make-debug
- (narrow-stack->vector
- stack
- ;; Cut three frames from the top of the stack:
- ;; make-stack, this one, and the throw handler.
- 3
- ;; Narrow the end of the stack to the most recent
- ;; start-stack.
- (and (pair? (fluid-ref %stacks))
- (cdar (fluid-ref %stacks))))
+ (let ((tag (and (pair? (fluid-ref %stacks))
+ (cdar (fluid-ref %stacks)))))
+ (narrow-stack->vector
+ stack
+ ;; Cut three frames from the top of the stack:
+ ;; make-stack, this one, and the throw handler.
+ 3
+ ;; Narrow the end of the stack to the most recent
+ ;; start-stack.
+ tag
+ ;; And one more frame, because %start-stack invoking
+ ;; the start-stack thunk has its own frame too.
+ 0 (and tag 1)))
0)))
((@ (system repl repl) start-repl) #:debug debug)))))))
((pass)