From 90c8094aec494df062b383d439874b380cf03925 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sat, 22 Feb 2014 15:34:46 +0100 Subject: [PATCH] Avoid attempting to eta-reduce self-loops. * module/language/cps/simplify.scm (compute-eta-reductions): Avoid trying to eta-reduce a jump-to-self, as in (let lp () (lp)). This caused the compiler to hang. --- module/language/cps/simplify.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/language/cps/simplify.scm b/module/language/cps/simplify.scm index bd7909806..1733161bb 100644 --- a/module/language/cps/simplify.scm +++ b/module/language/cps/simplify.scm @@ -60,7 +60,7 @@ (for-each visit-fun funs) (visit-term body term-k term-args)) (($ $continue k src ($ $values args)) - (when (equal? term-args args) + (when (and (equal? term-args args) (not (eq? k term-k))) (hashq-set! table term-k k))) (($ $continue k src (and fun ($ $fun))) (visit-fun fun))