From unknown Sun Jun 22 17:17:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13838: [PATCH] Fix duplicate removal of with-fluids Resent-From: David Kastrup Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 28 Feb 2013 09:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13838 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch To: 13838@debbugs.gnu.org Cc: David Kastrup X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.136204458132513 (code B ref -1); Thu, 28 Feb 2013 09:44:01 +0000 Received: (at submit) by debbugs.gnu.org; 28 Feb 2013 09:43:01 +0000 Received: from localhost ([127.0.0.1]:55151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UB00y-0008SF-M8 for submit@debbugs.gnu.org; Thu, 28 Feb 2013 04:43:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36482) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UB00v-0008S5-02 for submit@debbugs.gnu.org; Thu, 28 Feb 2013 04:42:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAzz2-0006UA-H4 for submit@debbugs.gnu.org; Thu, 28 Feb 2013 04:41:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:47988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAzz2-0006Tq-ER for submit@debbugs.gnu.org; Thu, 28 Feb 2013 04:41:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAzz1-0002cq-9E for bug-guile@gnu.org; Thu, 28 Feb 2013 04:41:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAzz0-0006SH-1L for bug-guile@gnu.org; Thu, 28 Feb 2013 04:40:59 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAzyz-0006S9-Jy for bug-guile@gnu.org; Thu, 28 Feb 2013 04:40:57 -0500 Received: from localhost ([127.0.0.1]:58186 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAzyy-0001oZ-2C; Thu, 28 Feb 2013 04:40:56 -0500 Received: by lola (Postfix, from userid 1000) id E0CAA201C09; Thu, 28 Feb 2013 10:40:28 +0100 (CET) From: David Kastrup Date: Thu, 28 Feb 2013 10:40:16 +0100 Message-Id: <1362044416-8464-1-git-send-email-dak@gnu.org> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.9 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.6 (-------) 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 From unknown Sun Jun 22 17:17:08 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: David Kastrup Subject: bug#13838: closed (Re: bug#13838: [PATCH] Fix duplicate removal of with-fluids) Message-ID: References: <87y5e8wu6y.fsf@tines.lan> <1362044416-8464-1-git-send-email-dak@gnu.org> X-Gnu-PR-Message: they-closed 13838 X-Gnu-PR-Package: guile X-Gnu-PR-Keywords: patch Reply-To: 13838@debbugs.gnu.org Date: Thu, 28 Feb 2013 11:34:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1362051241-10327-1" This is a multi-part message in MIME format... ------------=_1362051241-10327-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #13838: [PATCH] Fix duplicate removal of with-fluids which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 13838@debbugs.gnu.org. --=20 13838: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D13838 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1362051241-10327-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 13838-done) by debbugs.gnu.org; 28 Feb 2013 11:34:00 +0000 Received: from localhost ([127.0.0.1]:55225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UB1kO-0002gN-CX for submit@debbugs.gnu.org; Thu, 28 Feb 2013 06:34:00 -0500 Received: from world.peace.net ([96.39.62.75]:36740) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UB1kM-0002gG-Iw for 13838-done@debbugs.gnu.org; Thu, 28 Feb 2013 06:33:59 -0500 Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UB1iO-0000v1-V5; Thu, 28 Feb 2013 06:31:57 -0500 From: Mark H Weaver To: David Kastrup Subject: Re: bug#13838: [PATCH] Fix duplicate removal of with-fluids References: <1362044416-8464-1-git-send-email-dak@gnu.org> Date: Thu, 28 Feb 2013 06:31:49 -0500 In-Reply-To: <1362044416-8464-1-git-send-email-dak@gnu.org> (David Kastrup's message of "Thu, 28 Feb 2013 10:40:16 +0100") Message-ID: <87y5e8wu6y.fsf@tines.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13838-done Cc: 13838-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Applied, thanks. Mark ------------=_1362051241-10327-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 28 Feb 2013 09:43:01 +0000 Received: from localhost ([127.0.0.1]:55151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UB00y-0008SF-M8 for submit@debbugs.gnu.org; Thu, 28 Feb 2013 04:43:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36482) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UB00v-0008S5-02 for submit@debbugs.gnu.org; Thu, 28 Feb 2013 04:42:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAzz2-0006UA-H4 for submit@debbugs.gnu.org; Thu, 28 Feb 2013 04:41:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:47988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAzz2-0006Tq-ER for submit@debbugs.gnu.org; Thu, 28 Feb 2013 04:41:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAzz1-0002cq-9E for bug-guile@gnu.org; Thu, 28 Feb 2013 04:41:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAzz0-0006SH-1L for bug-guile@gnu.org; Thu, 28 Feb 2013 04:40:59 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAzyz-0006S9-Jy for bug-guile@gnu.org; Thu, 28 Feb 2013 04:40:57 -0500 Received: from localhost ([127.0.0.1]:58186 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAzyy-0001oZ-2C; Thu, 28 Feb 2013 04:40:56 -0500 Received: by lola (Postfix, from userid 1000) id E0CAA201C09; Thu, 28 Feb 2013 10:40:28 +0100 (CET) From: David Kastrup To: bug-guile@gnu.org Subject: [PATCH] Fix duplicate removal of with-fluids Date: Thu, 28 Feb 2013 10:40:16 +0100 Message-Id: <1362044416-8464-1-git-send-email-dak@gnu.org> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.9 (----) X-Debbugs-Envelope-To: submit Cc: David Kastrup X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.6 (-------) 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 ------------=_1362051241-10327-1--