[m-rev.] for review: Fix some handling of ill-formed sequences in string module.

Julien Fischer jfischer at opturion.com
Tue Jul 26 18:30:54 AEST 2022

Hi Peter,

On Tue, 26 Jul 2022, Peter Wang wrote:

> I can add something to NEWS if required.

Please do so.

In light of the fixes to unsafe_index_{next,prev}_repl this should
probably go on to the release branch as well -- I will sort that after
it is committed.

> ----
> library/string.m:
>    Document that string.duplicate_char may throw an exception.
>    Fix string.all_match to fail if the string being tested contains
>    any ill-formed code unit sequences.

I think the documentation for string.all_match should say as much.

>    Fix the Mercury implementation of string.contains_char to continue
>    searching for the character past any ill-formed code unit sequences.

Do we even need the Mercury implementation since there are foreign_proc
implementations for all three target languages?

Again, I think the behaviour w.r.t ill-formed sequences should be

That looks fine otherwise.


More information about the reviews mailing list