guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 09/11: Fix bug in CPS2 simplify's "transform-conts"


From: Andy Wingo
Subject: [Guile-commits] 09/11: Fix bug in CPS2 simplify's "transform-conts"
Date: Wed, 20 May 2015 17:32:59 +0000

wingo pushed a commit to branch master
in repository guile.

commit 7d4ede040d06fcd0fc86cc373505a8550a41b06d
Author: Andy Wingo <address@hidden>
Date:   Wed May 20 11:37:28 2015 +0200

    Fix bug in CPS2 simplify's "transform-conts"
    
    * module/language/cps2/simplify.scm (transform-conts): Return a persistent 
intmap.
---
 module/language/cps2/simplify.scm |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/module/language/cps2/simplify.scm 
b/module/language/cps2/simplify.scm
index 43960c6..7416aa2 100644
--- a/module/language/cps2/simplify.scm
+++ b/module/language/cps2/simplify.scm
@@ -53,13 +53,14 @@
       (((x1 . l1) . (x2 . l2)) (lp l1 l2 (f x1 x2 seed))))))
 
 (define (transform-conts f conts)
-  (intmap-fold (lambda (k v out)
-                 (let ((v* (f k v)))
-                   (if (equal? v v*)
-                       out
-                       (intmap-add! out k v* (lambda (old new) new)))))
-               conts
-               conts))
+  (persistent-intmap
+   (intmap-fold (lambda (k v out)
+                  (let ((v* (f k v)))
+                    (if (equal? v v*)
+                        out
+                        (intmap-add! out k v* (lambda (old new) new)))))
+                conts
+                conts)))
 
 ;;; Continuations that simply forward their values to another may be
 ;;; elided via eta reduction over labels.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]