From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#41131: Bug in hash-table-merge! (and patch) Date: Fri, 12 Mar 2021 22:32:38 +0100 Message-ID: <87o8foxdl5.fsf@pobox.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10653"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: 41131-done@debbugs.gnu.org To: "Ricardo G. Herdt" Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Fri Mar 12 22:34:07 2021 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKpQ7-0002eN-92 for guile-bugs@m.gmane-mx.org; Fri, 12 Mar 2021 22:34:07 +0100 Original-Received: from localhost ([::1]:49278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKpQ6-0001CA-B5 for guile-bugs@m.gmane-mx.org; Fri, 12 Mar 2021 16:34:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKpQ2-0001BV-JU for bug-guile@gnu.org; Fri, 12 Mar 2021 16:34:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47022) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lKpQ2-0004JW-CA for bug-guile@gnu.org; Fri, 12 Mar 2021 16:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lKpQ2-0005LR-8n for bug-guile@gnu.org; Fri, 12 Mar 2021 16:34:02 -0500 Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Fri, 12 Mar 2021 21:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 41131 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Mail-Followup-To: 41131@debbugs.gnu.org, wingo@pobox.com, r.herdt@posteo.de Original-Received: via spool by 41131-done@debbugs.gnu.org id=D41131.161558478120431 (code D ref 41131); Fri, 12 Mar 2021 21:34:02 +0000 Original-Received: (at 41131-done) by debbugs.gnu.org; 12 Mar 2021 21:33:01 +0000 Original-Received: from localhost ([127.0.0.1]:58566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lKpP3-0005JN-Cb for submit@debbugs.gnu.org; Fri, 12 Mar 2021 16:33:01 -0500 Original-Received: from fanzine.igalia.com ([178.60.130.6]:42499) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lKpOy-0005J2-F9 for 41131-done@debbugs.gnu.org; Fri, 12 Mar 2021 16:32:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=XxnjmRz1crsmkAlDa4euT6jQRXXiqJEL4L65rTt6hMw=; b=jBNXO4/v0arRvzMlIhdKjRjVWnTZMcREk2gCzDyHqkw0g5KThDPUv/1dmKUU+P7uB5fXYi6IlSZTedcGT1aL7sLC4NrK8rLFt9ptsCIqu8EP/kRwYPUNkLUKDX0Q7PfT+iftY0pAX0TaC6CObqaYRxtgDIxQT9sfESBuo5Zxrv5WRvdPIXr5J423YNEGuhUdyIHntG4hf/EPKFZiguVxtBpJFssQgOKznoCqcn+9ZnjeDDqIjO/UnPft4I0tb3G2Uo8j1zUQ5c2GCr1tk5Xs1L2n4nk6YfEpDfGdLz0izrp/zkX4K1ajj3n43tRm0IoHZURiG9N5OFZdE/7iDkY8GQ==; Original-Received: from 82-65-63-215.subs.proxad.net ([82.65.63.215] helo=sparrow) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1lKpOr-0007Aq-3I; Fri, 12 Mar 2021 22:32:49 +0100 In-Reply-To: (Ricardo G. Herdt's message of "Fri, 08 May 2020 01:50:01 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:9993 Archived-At: Applied, thanks! On Fri 08 May 2020 01:50, "Ricardo G. Herdt" writes: > Hi, > > I just found this bug in the hash-table-merge! function > (modul/srfi/srfi-69.scm). Instead of merging both hash tables, it was > ignoring one of them (other-ht). Attached is the fix, where it now folds > over other-ht and store its data in ht. > > Cheers, > > Ricardo G. Herdt > > From 180a9e14b807295aa31966a52bfd732647458ef9 Mon Sep 17 00:00:00 2001 > From: "Ricardo G. Herdt" > Date: Fri, 8 May 2020 01:37:24 +0200 > Subject: [PATCH] Fix hash-table-merge! bug. > > * module/srfi/srfi-69.scm : fold over second hash table. > --- > module/srfi/srfi-69.scm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/module/srfi/srfi-69.scm b/module/srfi/srfi-69.scm > index b9486c465..91bcc77db 100644 > --- a/module/srfi/srfi-69.scm > +++ b/module/srfi/srfi-69.scm > @@ -330,7 +330,7 @@ Answer the final F result." > "Add all key/value pairs from OTHER-HT to HT, overriding HT's > mappings where present. Return HT." > (hash-table-fold > - ht (lambda (k v ign) (hash-table-set! ht k v)) #f) > + other-ht (lambda (k v ign) (hash-table-set! ht k v)) #f) > ht) > > ;;; srfi-69.scm ends here