fix a bug in `free-identifier=?'

The bug is related to macro-introduced `require' and rename on
export.
This commit is contained in:
Matthew Flatt 2012-10-31 08:03:47 -06:00
parent f852b9eb92
commit 08c659c5d5
2 changed files with 28 additions and 1 deletions

View File

@ -1637,6 +1637,28 @@
f-id
(eval '(extract f f2 f2 #t))))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Check interaction of marks, `rename-out', and `free-identifier=?'
(module check-free-eq-with-rename racket/base
(require (for-syntax racket/base))
(provide (rename-out [prefix:quote quote])
check)
(define-syntax (check stx)
(syntax-case stx ()
[(_ id) #`#,(free-identifier=? #'id #'prefix:quote)]))
(define-syntax-rule (prefix:quote x) (quote x)))
(module use-rename-checker racket/base
(define-syntax-rule (body)
(begin
(provide v)
(require 'check-free-eq-with-rename)
(define v (check quote))))
(body))
(test #t dynamic-require ''use-rename-checker 'v)
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(report-errs)

View File

@ -4549,7 +4549,12 @@ static Scheme_Object *get_module_src_name(Scheme_Object *a, Scheme_Object *orig_
if (SCHEME_FALSEP(bdg))
bdg = get_old_module_env(a);
}
result = search_shared_pes(mrn->shared_pes, glob_id, a, bdg, NULL, 1, 0, NULL);
rename = search_shared_pes(mrn->shared_pes, glob_id, a, bdg, NULL, 1, 0, NULL);
if (rename) {
if (mrn->kind == mzMOD_RENAME_MARKED)
skip_other_mods = 1;
result = rename;
}
} else {
/* match; set result: */
if (mrn->kind == mzMOD_RENAME_MARKED)