guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 06/13: Fix error printing some wrong-num-args backtraces


From: Andy Wingo
Subject: [Guile-commits] 06/13: Fix error printing some wrong-num-args backtraces
Date: Wed, 22 Jul 2015 15:32:27 +0000

wingo pushed a commit to branch master
in repository guile.

commit 08cf30f2a0fc6c9e0851e229a11c09ab9aaacec0
Author: Andy Wingo <address@hidden>
Date:   Mon Jul 20 16:24:49 2015 +0200

    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 300145d..6fff660 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 "address@hidden:[~*~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 ac5fbf6..b84f668 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]