Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs

From: Pip Cet <[email-masked]>
Date: Thu, 16 Jan 2025 13:06:12 +0000

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

>> Date: Thu, 16 Jan 2025 12:08:37 +0000
>> From: Pip Cet <[email-masked]>
>> Cc: [email-masked], [email-masked], [email-masked], [email-masked]
>>
>> >> (Also, this is not primarily about circular lists, it's about non-lists
>> >> in general).
>> >
>> > That should be easy to detect up front, no?  I thought the issue was
>> > about a cons cell vs a proper list.
>>
>> Sorry, but I don't see a way of checking that we're looking at a proper
>> list that's cheaper that list_length: we need to find the last cons
>> cell, so we need to walk the list, and counting cells while we're doing
>> so should not affect performance.
>
> No, I meant to detect objects that are not CONSP, but something else:
> a number, a symbol, a string, etc.  I thought this was what you meant
> by "non-lists".

Oh, my apologies.  I said "non-list" when what I meant was an "improper
list", in Emacs jargon.  Dotted "lists" caused the crash for the OP;
circular "lists" cause infloops, but no crashes.  The code already
treats !CONSP !NILP objects specially (only Qt as a value is documented,
the rest are silently treated like Qt is).

Pip