From 7fedd7b7add43df04442b0f6738350025fba0c27 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sat, 9 May 2015 14:52:47 +0200 Subject: [PATCH] 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 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/language/cps/intset.scm b/module/language/cps/intset.scm index 9fc44bd59..60621d60f 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)