GNU bug report logs - #34781
27.0.50; integer in pcase sometimes compared by eq

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattiase <at> acm.org>

Date: Thu, 7 Mar 2019 15:16:02 UTC

Severity: normal

Tags: patch

Found in version 27.0.50

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#34781: closed (27.0.50; integer in pcase sometimes compared
 by eq)
Date: Thu, 28 Mar 2019 23:04:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 29 Mar 2019 00:03:01 +0100
with message-id <821c6aaec1660201230fe27a7e11105c70ccfe4f.camel <at> acm.org>
and subject line Re: 27.0.50; integer in pcase sometimes compared by eq
has caused the debbugs.gnu.org bug report #34781,
regarding 27.0.50; integer in pcase sometimes compared by eq
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
34781: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34781
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mattias Engdegård <mattiase <at> acm.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; integer in pcase sometimes compared by eq
Date: Thu, 07 Mar 2019 16:13:27 +0100
(defun f (x)
  (pcase x
    ((or 'a #x10000000000000000) t)))

(f #x10000000000000000) => nil

Just replacing integerp with fixnump fixes this, but I'm not sure if
more of the same lurks somewhere.

--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -792,7 +792,7 @@ pcase--u1
                    (let ((upat (cddr alt)))
                      (eq (car-safe upat) 'quote)))
               (let ((val (cadr (cddr alt))))
-                (unless (or (integerp val) (symbolp val))
+                (unless (or (fixnump val) (symbolp val))
                   (setq memq-ok nil))
                 (push (cadr (cddr alt)) simples))
             (push alt others))))




[Message part 3 (message/rfc822, inline)]
From: Mattias Engdegård <mattiase <at> acm.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>, Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 34781-done <at> debbugs.gnu.org
Subject: Re: 27.0.50; integer in pcase sometimes compared by eq
Date: Fri, 29 Mar 2019 00:03:01 +0100
[Message part 4 (text/plain, inline)]
tor 2019-03-28 klockan 15:38 -0700 skrev Paul Eggert:
> On 3/28/19 3:20 PM, Mattias Engdegård wrote:
> > I'll do the obvious (unless you beat me to it).
> 
> When you do that, please also change the name of the local from memq-
> ok
> to memql-ok, for clarity. Thanks.

Done. Thanks for your help! I'm attaching the mostly cleaned-up patch
(minus the necessary doc changes), in case someone will see some use
for it.

[0001-Add-bounds-for-portable-fixnums-and-portable-fixnum-.patch (text/x-patch, attachment)]

This bug report was last modified 6 years and 54 days ago.

Previous Next


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