GNU bug report logs - #56413
[PATCH 1/1] scm_i_utf8_string_hash: compute u8 chars not bytes

Previous Next

Package: guile;

Reported by: Rob Browning <rlb <at> defaultvalue.org>

Date: Wed, 6 Jul 2022 01:25:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Rob Browning <rlb <at> defaultvalue.org>
To: 56413 <at> debbugs.gnu.org
Subject: bug#56413: [PATCH 1/1] scm_i_utf8_string_hash: compute u8 chars not bytes
Date: Tue, 05 Jul 2022 22:04:08 -0500
Rob Browning <rlb <at> defaultvalue.org> writes:

> Noticed while investigating a migration to utf-8 strings.  After making
> changes that routed non-ascii symbol hashing through this function,
> encoding-iso88597.test began intermittently failing because it would
> traverse trailing garbage when u8_strnlen reported 8 chars instead of 4.
>
> Change the scm_i_str2symbol internal hash type to unsigned long to
> explicitly match the hashing result type.

Hmm.  I suppose the current test could be handled on the scheme side
instead.  (I'd started off attempting some more direct, elaborate tests
that didn't pan out.)  Happy to rework that if desired.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4




This bug report was last modified 2 years and 65 days ago.

Previous Next


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