Subject: bug#70988: (read FUNCTION) uses Latin-1 [PATCH]

From: Pip Cet <[email-masked]>
Date: Thu, 13 Feb 2025 17:11:35 +0000

"Eli Zaretskii" <[email-masked]> writes:

>> Date: Thu, 13 Feb 2025 14:08:02 +0000
>> From: Pip Cet <[email-masked]>
>> Cc: Mattias Engdegård <[email-masked]>, [email-masked], Eli Zaretskii <[email-masked]>, [email-masked]
>>
>> @@ -3058,7 +3058,8 @@ read_char_escape (Lisp_Object readcharfun, int next_char)
>>        chr = c;
>>        break;
>>      }
>> -  eassert (chr >= 0 && chr < (1 << CHARACTERBITS));
>> +  if (chr < 0 || chr > (1 << CHARACTERBITS))
>> +    invalid_syntax ("Invalid character", readcharfun);
>
> Please leave the assertion in place here (in addition to the error
> message), since an abort is easier to spot than an error message,
> especially if someone catches errors at a higher level.

Just to clarify, you want

@@ -3058,7 +3058,8 @@ read_char_escape (Lisp_Object readcharfun, int next_char)
       chr = c;
       break;
     }
   eassert (chr >= 0 && chr < (1 << CHARACTERBITS));
+  if (chr < 0 || chr >= (1 << CHARACTERBITS))
+    invalid_syntax ("Invalid character", readcharfun);

?

Thanks!

Pip