From 029af6f68ab7bbe02e1cc189c8f99e7e754daf74 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 27 Nov 2015 12:25:26 +0100 Subject: [PATCH] frame-call-representation avoids frame-procedure. * module/system/vm/frame.scm (frame-call-representation): Never use frame-procedure, as we don't know that slot 0 is a SCM value and even if it were, we don't know that it corresponds to the procedure being applied, except in the case of primcalls. Print _ as the procedure name if we don't know it, instead of #f. --- module/system/vm/frame.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/module/system/vm/frame.scm b/module/system/vm/frame.scm index e9dc2ee33..4ce4d7f3e 100644 --- a/module/system/vm/frame.scm +++ b/module/system/vm/frame.scm @@ -364,8 +364,7 @@ (define* (frame-call-representation frame #:key top-frame?) (let* ((ip (frame-instruction-pointer frame)) (info (find-program-debug-info ip)) - (nlocals (frame-num-locals frame)) - (closure (frame-procedure frame))) + (nlocals (frame-num-locals frame))) (define (find-slot i bindings) (match bindings (() #f) @@ -410,7 +409,7 @@ (else '()))) (cons - (frame-procedure-name frame #:info info) + (or (frame-procedure-name frame #:info info) '_) (cond ((find-program-arity ip) => (lambda (arity) @@ -423,7 +422,7 @@ (arity-has-rest? arity) 1)))) ((and (primitive-code? ip) - (program-arguments-alist closure ip)) + (program-arguments-alist (frame-local-ref frame 0 'scm) ip)) => (lambda (args) (match args ((('required . req)