GNU bug report logs - #13838
[PATCH] Fix duplicate removal of with-fluids

Previous Next

Package: guile;

Reported by: David Kastrup <dak <at> gnu.org>

Date: Thu, 28 Feb 2013 09:44:01 UTC

Severity: normal

Tags: patch

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Mark H Weaver <mhw <at> netris.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#13838: closed ([PATCH] Fix duplicate removal of with-fluids)
Date: Thu, 28 Feb 2013 11:34:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 28 Feb 2013 06:31:49 -0500
with message-id <87y5e8wu6y.fsf <at> tines.lan>
and subject line Re: bug#13838: [PATCH] Fix duplicate removal of with-fluids
has caused the debbugs.gnu.org bug report #13838,
regarding [PATCH] Fix duplicate removal of with-fluids
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
13838: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13838
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: David Kastrup <dak <at> gnu.org>
To: bug-guile <at> gnu.org
Cc: David Kastrup <dak <at> gnu.org>
Subject: [PATCH] Fix duplicate removal of with-fluids
Date: Thu, 28 Feb 2013 10:40:16 +0100
The following code displayed #f:

(define a (make-fluid))
(define b (make-fluid))
(with-fluids ((a 3) (a 1) (b 2))
	     (display (fluid-ref b)))

In general, removing any duplicate that is not right at the end of the
(remaining) list will exhibit this problem.  The fluids and vals
arguments are modified in situ; the previous code only modified vals.
---
 libguile/fluids.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libguile/fluids.c b/libguile/fluids.c
index f1c09cb..bd59e26 100644
--- a/libguile/fluids.c
+++ b/libguile/fluids.c
@@ -326,6 +326,8 @@ scm_i_make_with_fluids (size_t n, SCM *fluids, SCM *vals)
           {
             vals[i] = vals[j]; /* later bindings win */
             n--;
+            fluids[j] = fluids[n];
+            vals[j] = vals[n];
             break;
           }
   }
-- 
1.7.10.4



[Message part 3 (message/rfc822, inline)]
From: Mark H Weaver <mhw <at> netris.org>
To: David Kastrup <dak <at> gnu.org>
Cc: 13838-done <at> debbugs.gnu.org
Subject: Re: bug#13838: [PATCH] Fix duplicate removal of with-fluids
Date: Thu, 28 Feb 2013 06:31:49 -0500
Applied, thanks.

     Mark


This bug report was last modified 12 years and 88 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.