From 08cf30f2a0fc6c9e0851e229a11c09ab9aaacec0 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 20 Jul 2015 16:24:49 +0200 Subject: Fix error printing some wrong-num-args backtraces * module/system/repl/debug.scm (print-frame): Pass #:top-frame? #t for the top frame. * module/system/vm/frame.scm (available-bindings): Be permissive and allow #:top-frame? #f even when the IP is at the start of the function. --- module/system/repl/debug.scm | 5 +++-- module/system/vm/frame.scm | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/module/system/repl/debug.scm b/module/system/repl/debug.scm index 300145d16..6fff660e5 100644 --- a/module/system/repl/debug.scm +++ b/module/system/repl/debug.scm @@ -1,6 +1,6 @@ ;;; Guile VM debugging facilities -;;; Copyright (C) 2001, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. +;;; Copyright (C) 2001, 2009, 2010, 2011, 2013, 2014, 2015 Free Software Foundation, Inc. ;;; ;;; This library is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU Lesser General Public @@ -134,7 +134,8 @@ (format port "~&In ~a:~&" file)) (format port "~9@a~:[~*~3_~;~3d~] ~v:@y~%" (if line (format #f "~a:~a" line col) "") - index index width (frame-call-representation frame)) + index index width + (frame-call-representation frame #:top-frame? (zero? index))) (if full? (print-locals frame #:width width #:per-line-prefix " ")))) diff --git a/module/system/vm/frame.scm b/module/system/vm/frame.scm index ac5fbf6f5..b84f6683e 100644 --- a/module/system/vm/frame.scm +++ b/module/system/vm/frame.scm @@ -206,7 +206,10 @@ (when (< offset 0) (error "ip did not correspond to an instruction boundary?")) (if (zero? offset) - (let ((live (if top-frame? + ;; It shouldn't be the case that both OFFSET and N are zero + ;; but TOP-FRAME? is false. Still, it could happen, as is + ;; currently the case in frame-arguments. + (let ((live (if (or top-frame? (zero? n)) (vector-ref inv n) ;; If we're not at a top frame, the IP points ;; to the continuation -- but we haven't -- cgit v1.2.3