GNU bug report logs - #58531
29.0.50; Wrong predicate used by map-elt gv getter

Previous Next

Package: emacs;

Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Date: Fri, 14 Oct 2022 21:46:02 UTC

Severity: normal

Tags: patch

Found in version 29.0.50

Fixed in version 29.1

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>, 58531 <at> debbugs.gnu.org
Subject: Re: bug#58531: 29.0.50; Wrong predicate used by map-elt gv getter
Date: Sat, 22 Oct 2022 21:04:27 +0300
Basil L. Contovounesios [2022-10-16 01:41 +0300] wrote:

> Stefan Monnier [2022-10-15 11:52 -0400] wrote:
>
>>> -(defun eudc-plist-member (plist prop)
>>> -  "Return t if PROP has a value specified in PLIST."
>>> -  (if (not (= 0 (% (length plist) 2)))
>>> +(defun eudc--plist-member (plist prop &optional predicate)
>>> +  "Like `plist-member', but signal on invalid PLIST."
>>> +  ;; Could also use `plistp', but that would change the error.
>>> +  (or (zerop (% (length plist) 2))
>>>        (error "Malformed plist"))
>>> -  (catch 'found
>>> -    (while plist
>>> -      (if (eq prop (car plist))
>>> -	  (throw 'found t))
>>> -      (setq plist (cdr (cdr plist))))
>>> -    nil))
>>> +  (plist-member plist prop predicate))
>>
>> The current error is poor (it doesn't include the offending plist, for
>> example), so I think changing it (e.g. using the usual
>> `wrong-type-argument` error) would be for the better.
>> I do wonder whether it's worth the trouble keeping the error here, tho,
>> instead of just using `plist-member` directly.
>
> I was just being conservative, because I don't know where EUDC might get
> its data from, or how important it is to catch dubious plists
> red-handed.
>
> I'd be happy to simplify the code, but let's see if Thomas (CCed) has
> any comments.  Thomas, the patch touching eudc.el can be found at:
> https://bugs.gnu.org/58531#8.

I've now moved this subdiscussion to https://bugs.gnu.org/58720.

-- 
Basil




This bug report was last modified 2 years and 270 days ago.

Previous Next


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