fix a bug in ->i parsing

This commit is contained in:
Robby Findler 2013-02-27 18:26:36 -06:00
parent 03751b8f34
commit 48b2410755
2 changed files with 14 additions and 2 deletions

View File

@ -172,7 +172,10 @@ code does the parsing and validation of the syntax.
(set! sp (cons from sp))
(free-identifier-mapping-put!
neighbors from
(cons to (free-identifier-mapping-get neighbors from (λ () '())))))
(cons to (free-identifier-mapping-get neighbors from))))
(define (init-neighbors var)
(free-identifier-mapping-put! neighbors var '()))
(define (no-links from)
(set! sp (cons from sp))
@ -182,6 +185,7 @@ code does the parsing and validation of the syntax.
(for ([a-res (in-list arg/ress)])
(cond
[(arg/res-vars a-res)
(init-neighbors (arg/res-var a-res))
(for ([nvar (in-list (arg/res-vars a-res))])
(link (arg/res-var a-res) nvar))]
[else
@ -196,6 +200,7 @@ code does the parsing and validation of the syntax.
(when a-rst
(cond
[(arg/res-vars a-rst)
(init-neighbors (arg/res-var a-rst))
(for ([nvar (in-list (arg/res-vars a-rst))])
(link (arg/res-var a-rst) nvar))]
[else

View File

@ -3341,6 +3341,13 @@
'neg)
1))
;; this used to cause a runtime error in the code that parses ->i
(ctest 'no-crash
'->i-no-vars-with-dep
(begin (->i ([x () any/c] [y (x) any/c]) any) 'no-crash))
;
;
;
@ -12854,7 +12861,7 @@ so that propagation occurs.
'pos
'neg))
(f 10)))
;