Guard free-identifier=? comparisons in shared. (#2382)

Fixes #2381.
This commit is contained in:
Sam Tobin-Hochstadt 2018-11-17 22:26:11 -05:00 committed by GitHub
parent c4189ff934
commit c1d2e4031e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 12 deletions

View File

@ -49,4 +49,6 @@
(test an-a 'an-a (shared ([t (a 1 t)])
t)))
(test 42 values (shared ((b ((thunk 42)))) b))
(test 42 unbox (shared ((b (box-immutable ((thunk 42))))) b))
(report-errs)

View File

@ -76,18 +76,20 @@
[same-special-id? (lambda (a b)
;; Almost module-or-top-identifier=?,
;; but handle `the-cons' specially
(or (free-identifier=?
a
(if (eq? 'the-cons (syntax-e b))
cons-id
b))
(free-identifier=?
a
(datum->syntax
#f
(if (eq? 'the-cons (syntax-e b))
'cons
(syntax-e b))))))]
(and (identifier? a)
(identifier? b)
(or (free-identifier=?
a
(if (eq? 'the-cons (syntax-e b))
cons-id
b))
(free-identifier=?
a
(datum->syntax
#f
(if (eq? 'the-cons (syntax-e b))
'cons
(syntax-e b)))))))]
[remove-all (lambda (lst rmv-lst)
(define (remove e l)
(cond