fix taint-check ordering in expander

Merge to v6.3
This commit is contained in:
Matthew Flatt 2015-10-20 19:38:39 -06:00
parent 5a768de132
commit 7b7a315777
2 changed files with 12 additions and 1 deletions

View File

@ -1553,6 +1553,17 @@
(test 'outer dynamic-require ''should-be-outer-4 'd)
;; ----------------------------------------
;; Check that taint check precedes bound-with-binding substitution:
(err/rt-test (expand '(let ([x 1])
(let-syntax ([m (lambda (stx)
#`(list #,(syntax-taint #'x)))])
(m))))
(lambda (exn)
(regexp-match? #rx"cannot use identifier tainted by macro transformation"
(exn-message exn))))
;; ----------------------------------------
(report-errs)

View File

@ -1257,9 +1257,9 @@ scheme_compile_lookup(Scheme_Object *find_id, Scheme_Comp_Env *env, int flags,
for (i = frame->num_bindings; i--; ) {
if (frame->bindings[i] && SAME_OBJ(binding, frame->bindings[i])) {
/* Found a lambda-, let-, etc. bound variable: */
check_taint(find_id);
if (_binder)
set_binder(_binder, find_id, frame->binders[i]);
check_taint(find_id);
if (!frame->vals) {
if (flags & SCHEME_DONT_MARK_USE)