bug#56413: [PATCH 1/1] scm_i_utf8_string_hash: compute u8 chars not bytes

Ludovic Courtès <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
Rob Browning <[email protected]> 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’.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.