Check for incomplete blame information and error.
This commit is contained in:
parent
7d45129fca
commit
11732128b3
|
@ -31,6 +31,12 @@
|
|||
(blame-swap b) ; swap back
|
||||
b))))
|
||||
(define regular-profile (analyze-samples samples*))
|
||||
;; all blames must be complete, otherwise we get bogus profiles
|
||||
(for ([b (in-list all-blames)])
|
||||
(unless (and (blame-positive b)
|
||||
(blame-negative b))
|
||||
(error (string-append "contract-profile: incomplete blame:\n"
|
||||
(format-blame b)))))
|
||||
(contract-profile
|
||||
total-time live-contract-samples all-blames regular-profile))
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
(lambda () body ...))))
|
||||
|
||||
;; for debugging
|
||||
(define (print-blame b)
|
||||
(printf (string-append "#<blame positive=~a\n"
|
||||
(define (format-blame b)
|
||||
(format (string-append "#<blame positive=~a\n"
|
||||
" negative=~a\n"
|
||||
" contract=~a\n"
|
||||
" value=~a\n"
|
||||
|
|
Loading…
Reference in New Issue
Block a user