[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 03/03: Fix intmap-add! transient bug
From: |
Andy Wingo |
Subject: |
[Guile-commits] 03/03: Fix intmap-add! transient bug |
Date: |
Fri, 08 May 2015 12:48:58 +0000 |
wingo pushed a commit to branch master
in repository guile.
commit 0f082bd3f7ad4854333728c6d0f71ef7df1fbec3
Author: Andy Wingo <address@hidden>
Date: Fri May 8 14:09:40 2015 +0200
Fix intmap-add! transient bug
* module/language/cps/intmap.scm (intmap-add!): Fix a bug creating a
transient branch out of a persistent branch.
---
module/language/cps/intmap.scm | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/module/language/cps/intmap.scm b/module/language/cps/intmap.scm
index 146b550..9081f33 100644
--- a/module/language/cps/intmap.scm
+++ b/module/language/cps/intmap.scm
@@ -174,7 +174,10 @@
(#f (let ((v (new-branch edit)))
(vector-set! root idx v)
v))
- (v (writable-branch v edit)))))
+ (v (let ((v* (writable-branch v edit)))
+ (unless (eq? v v*)
+ (vector-set! root idx v*))
+ v*)))))
(define (adjoin! i shift root)
(let* ((shift (- shift *branch-bits*))
(idx (logand (ash i (- shift)) *branch-mask*)))