mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-10 06:27:32 +02:00
Added safety checks
This commit is contained in:
parent
7ed21d9c7a
commit
ff65b5d2ed
1 changed files with 21 additions and 15 deletions
|
@ -1959,8 +1959,14 @@
|
||||||
))))))
|
))))))
|
||||||
|
|
||||||
|
|
||||||
|
(with-handler
|
||||||
|
(lambda (err)
|
||||||
|
(trace:error `(error transforming CC loop ,err))
|
||||||
|
result)
|
||||||
(cond
|
(cond
|
||||||
(replace
|
((and replace
|
||||||
|
(tagged-list? '%closure (car result)) ;; TODO: see above, not always a closure, what to do then?
|
||||||
|
)
|
||||||
(define (clo->lambda-body sexp)
|
(define (clo->lambda-body sexp)
|
||||||
(car (ast:lambda-body (cadr sexp))))
|
(car (ast:lambda-body (cadr sexp))))
|
||||||
|
|
||||||
|
@ -1973,7 +1979,7 @@
|
||||||
(set-cdr! outer-body `((cell ,set-clo))) ;; Relocate the closure
|
(set-cdr! outer-body `((cell ,set-clo))) ;; Relocate the closure
|
||||||
result
|
result
|
||||||
))
|
))
|
||||||
(else result))
|
(else result)))
|
||||||
))
|
))
|
||||||
((lambda? fn) (error `(Unexpected lambda in closure-convert ,exp)))
|
((lambda? fn) (error `(Unexpected lambda in closure-convert ,exp)))
|
||||||
(else
|
(else
|
||||||
|
|
Loading…
Add table
Reference in a new issue