From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#56413: [PATCH 1/1] scm_i_utf8_string_hash: compute u8 chars not bytes Date: Mon, 07 Nov 2022 14:07:54 +0100 Message-ID: <87tu3aud3p.fsf@gnu.org> References: <20220706012323.1024763-1-rlb@defaultvalue.org> <87zgd5gi4t.fsf@gnu.org> <87zgd3vpb7.fsf@trouble.defaultvalue.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19551"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: 56413@debbugs.gnu.org To: Rob Browning Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Mon Nov 07 14:09:21 2022 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 1os1sO-0004tp-Ma for guile-bugs@m.gmane-mx.org; Mon, 07 Nov 2022 14:09:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1os1sE-0001bY-F2; Mon, 07 Nov 2022 08:09:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1os1s7-0001W1-17 for bug-guile@gnu.org; Mon, 07 Nov 2022 08:09:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1os1s6-0007xI-Mm for bug-guile@gnu.org; Mon, 07 Nov 2022 08:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1os1s6-0001mr-IU for bug-guile@gnu.org; Mon, 07 Nov 2022 08:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 07 Nov 2022 13:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56413 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Original-Received: via spool by 56413-submit@debbugs.gnu.org id=B56413.16678264846798 (code B ref 56413); Mon, 07 Nov 2022 13:09:02 +0000 Original-Received: (at 56413) by debbugs.gnu.org; 7 Nov 2022 13:08:04 +0000 Original-Received: from localhost ([127.0.0.1]:33606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1os1rA-0001la-8D for submit@debbugs.gnu.org; Mon, 07 Nov 2022 08:08:04 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1os1r7-0001kw-Fw for 56413@debbugs.gnu.org; Mon, 07 Nov 2022 08:08:02 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1os1r2-0005Ih-9S; Mon, 07 Nov 2022 08:07:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=2gPzJ4o4IkBdtX4Du1L3qocYbS7ht7NtXONdO6+kJt4=; b=FxYZEuYpfqntDXCtGdBr gv44vsbJsQauhZwWAoPnzXszvt7uQAsml162iwh7wQbMlGzYU+JvZaTmyEwm3HVnA0NZ8PlyW0aw/ IljIRygSX3koDpuw/D8FqaGqvoMCn9iHCR4nKPNazLfWw0RvsaZzyNilaCaV6LidTj05EsqsvwAYx AJI2bKbOgkgKTz3y9gRZQhdVovbHdSI7WJ9X4L24LzaKAQ5jhS0dRbHIZjdEiWJvl4abK+60EMbfV IjxPClXry9+2GAg/DBEsNGWJ49Q8uN++P9NRlaMLW468E+KTq65eQ2YtHC2QXQt/lTVw8I0RLiS3I 3tPB5pxBdmdU0Q==; Original-Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1os1r1-0004dU-FL; Mon, 07 Nov 2022 08:07:55 -0500 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Septidi 17 Brumaire an 231 de la =?UTF-8?Q?R=C3=A9volution, ?= jour du Cresson X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu In-Reply-To: <87zgd3vpb7.fsf@trouble.defaultvalue.org> (Rob Browning's message of "Sun, 06 Nov 2022 13:46:36 -0600") 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-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10418 Archived-At: Rob Browning skribis: > So this change *could* alter results, but only for non-ASCII strings, > and those results would have been wrong (i.e. relying on uninitialized > memory). OK, that was my understanding too. > That leaves the size_t -> long change in scm_i_str2symbol(), and I don't > think that has anything to do with UTF-8, but it could cause mangling of > the value on any platform where the data types differ sufficiently, and > then of course if we're not using the same type consistently, then we > could give different answers for the same symbol in different contexts > (for different code paths). Right. This one looks safe to me. > And indeed, looks like I missed another case; just below in > scm_i_str2uninterned_symbol() we also use size_t. For now, I suspect we > should change both or neither, and definitely change them all to match > "eventually". Sure. Thanks! Ludo=E2=80=99.