fix re-export of shadowing binding

Mishandling of the `require`-binding table could cause
`racket/private/pre-base` to export `andmap` as syntax, for example,
instead of as a variable. The syntax-versus-variable distinction
doesn't usually matter, but it affects the order of exports in
bytecode form.
This commit is contained in:
Matthew Flatt 2015-11-12 14:01:58 -07:00
parent b5e2ae030b
commit a053c78c30

View File

@ -7672,7 +7672,10 @@ static void check_require_name(Scheme_Object *id, Scheme_Object *self_modidx,
&& prep_required_id(vec)
&& scheme_stx_bound_eq(SCHEME_VEC_ELS(vec)[6], id, phase)) {
/* can override; first, remove old binding mapping: */
scheme_hash_set(required, binding, NULL);
if (SCHEME_SYMBOLP(binding))
scheme_hash_set(required, binding, scheme_false);
else
scheme_hash_set(required, binding, NULL);
/* construct overriding `binding`: */
binding = scheme_make_vector(4, NULL);
vec = scheme_module_resolve(modidx, 0);