summaryrefslogtreecommitdiff
path: root/module/system/vm/coverage.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/system/vm/coverage.scm')
-rw-r--r--module/system/vm/coverage.scm14
1 files changed, 8 insertions, 6 deletions
diff --git a/module/system/vm/coverage.scm b/module/system/vm/coverage.scm
index 0f4c73ec9..17e2f40eb 100644
--- a/module/system/vm/coverage.scm
+++ b/module/system/vm/coverage.scm
@@ -199,12 +199,14 @@ coverage data. Return code coverage data and the values returned by THUNK."
if PROC was not executed. When PROC is a closure, the number of times its code
was executed is returned, not the number of times this code associated with this
particular closure was executed."
- (and=> (hashx-ref hashq-proc assq-proc
- (data-procedure->ip-counts data) proc)
- (let ((sources (program-sources* data proc)))
- (lambda (ip-counts)
- (let ((entry-ip (source:addr (car sources)))) ;; FIXME: broken with lambda*
- (hashv-ref ip-counts entry-ip 0))))))
+ (let ((sources (program-sources* data proc)))
+ (and (pair? sources)
+ (and=> (hashx-ref hashq-proc assq-proc
+ (data-procedure->ip-counts data) proc)
+ (lambda (ip-counts)
+ ;; FIXME: broken with lambda*
+ (let ((entry-ip (source:addr (car sources))))
+ (hashv-ref ip-counts entry-ip 0)))))))
(define (program-sources* data proc)
;; A memoizing version of `program-sources'.