GNU bug report logs - #68113
Wrong error message triggered in cl--generic-standard-method-combination

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Fri, 29 Dec 2023 16:51:02 UTC

Severity: normal

Tags: notabug

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 68113 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 68113 <at> debbugs.gnu.org
Subject: Re: bug#68113: Wrong error message triggered in
 cl--generic-standard-method-combination
Date: Mon, 01 Jan 2024 23:39:57 -0500
> , and at the time of calling, qualifiers was nil.  So the call boiled
> down to
>
>     (push method (alist-get nil mets-by-qual))
>
> , and there was no element of mets-by-qual with a car of nil.  So what
> can the push macro do?  There's no list to push onto.  It can generate
> code either
> (i) to signal an error; or
> (ii) to create a new element in the alist mets-by-qual with method being
> the single element of its cdr.
>
> In actual fact, it does (i), but (as reported in the bug report) gives
> the wrong message.

But as I pointed out, the normal macroexpansion does (ii), so the
problem *is* in the wrong macroexpansion.

> That line of code is poor.  It assumes that (alist-get (car qualifiers)
> mets-by-qual) will always return a list element,

No, it doesn't.  The `gv-expander` for `alist-get` handles that case
just fine (tho for some reason not in your case, obviously).

> and fails to make any checks.  It fails to check that qualifiers is
> a non-empty list before taking its car.

It's on purpose.  The "nil" case is the common case, actually.
This has been working fine since Emacs-25, remember.

> Would you please check the code that signaled that error (you wrote it, I
> think), and let me know whether you find anything suspicious in it.

I already did.

Did you try the patch I sent?


        Stefan





This bug report was last modified 1 year and 188 days ago.

Previous Next


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