guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 02/07: Fix another intset transient bug


From: Andy Wingo
Subject: [Guile-commits] 02/07: Fix another intset transient bug
Date: Mon, 11 May 2015 20:46:10 +0000

wingo pushed a commit to branch master
in repository guile.

commit 7fedd7b7add43df04442b0f6738350025fba0c27
Author: Andy Wingo <address@hidden>
Date:   Sat May 9 14:52:47 2015 +0200

    Fix another intset transient bug
    
    * module/language/cps/intset.scm (intset-add!): If the root is a
      branch but isn't editable, be sure to actually update the transient
      intset's root to store the writable root.
---
 module/language/cps/intset.scm |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/module/language/cps/intset.scm b/module/language/cps/intset.scm
index 9fc44bd..60621d6 100644
--- a/module/language/cps/intset.scm
+++ b/module/language/cps/intset.scm
@@ -232,7 +232,10 @@
        ;; Add element to set; level will not change.
        (if (= shift *leaf-bits*)
            (set-transient-intset-root! bs (adjoin-leaf (- i min) root))
-           (adjoin-branch! (- i min) shift root)))
+           (let ((root* (writable-branch root edit)))
+             (unless (eq? root root*)
+               (set-transient-intset-root! bs root*))
+             (adjoin-branch! (- i min) shift root*))))
       (else
        (let lp ((min min)
                 (shift shift)



reply via email to

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