GNU bug report logs - #17681
24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators

Previous Next

Package: emacs;

Reported by: David Engster <deng <at> randomsample.de>

Date: Tue, 3 Jun 2014 19:14:02 UTC

Severity: normal

Found in version 24.3.91

Fixed in version 25.0.95

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

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: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#17681: closed (24.3.91; "Arithmetic Error" in hide-ifdef mode
 when using shift operators)
Date: Sun, 26 Jun 2016 04:54:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 26 Jun 2016 00:53:39 -0400
with message-id <CAM-tV-_vVhHkJzS2vU9jZWytD9GLzuHNWHP9oMKUBczqecTJQw <at> mail.gmail.com>
and subject line Re: bug#17681: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators
has caused the debbugs.gnu.org bug report #17681,
regarding 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators
to be marked as done.

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


-- 
17681: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17681
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: David Engster <deng <at> randomsample.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.91;
 "Arithmetic Error" in hide-ifdef mode when using shift operators
Date: Tue, 03 Jun 2014 21:12:33 +0200
Recipe:

- Create a file "test.h" containing the following (this is from
  the file 'jiffies.h' in the Linux kernel):

#if !((((NSEC_PER_SEC << 2) / TICK_NSEC) << (SEC_JIFFIE_SC - 2)) & 0x80000000)
#endif

- emacs -Q

- Load the file, activate hide-ifdef-mode

- C-c @ h  (hide-ifdefs)

The minibuffer will show "Arithmetic Error". Here is the backtrace:

Debugger entered--Lisp error: (arith-error)
  hif-divide(0 nil)
  (hif-shiftleft (hif-divide (hif-shiftleft (hif-lookup (quote NSEC_PER_SEC)) 2) (hif-lookup (quote TICK_NSEC))) (hif-minus (hif-lookup (quote SEC_JIFFIE_SC)) 2))
  (hif-logand (hif-shiftleft (hif-divide (hif-shiftleft (hif-lookup (quote NSEC_PER_SEC)) 2) (hif-lookup (quote TICK_NSEC))) (hif-minus (hif-lookup (quote SEC_JIFFIE_SC)) 2)) 2147483648.0)
  (hif-not (hif-logand (hif-shiftleft (hif-divide (hif-shiftleft (hif-lookup (quote NSEC_PER_SEC)) 2) (hif-lookup (quote TICK_NSEC))) (hif-minus (hif-lookup (quote SEC_JIFFIE_SC)) 2)) 2147483648.0))
  eval((hif-not (hif-logand (hif-shiftleft (hif-divide (hif-shiftleft (hif-lookup (quote NSEC_PER_SEC)) 2) (hif-lookup (quote TICK_NSEC))) (hif-minus (hif-lookup (quote SEC_JIFFIE_SC)) 2)) 2147483648.0)))
  hif-possibly-hide()
  hide-ifdef-guts()
  hide-ifdefs()

Earlier Emacsen did not throw an error here (although it is very
possible that the above line wasn't calculated correctly). Still, this
probably qualifies as a regression.

-David


[Message part 3 (message/rfc822, inline)]
From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: 17681-done <at> debbugs.gnu.org
Subject: Re: bug#17681: 24.3.91; "Arithmetic Error" in hide-ifdef mode when
 using shift operators
Date: Sun, 26 Jun 2016 00:53:39 -0400
Version: 25.0.95

I see the problem in Emacs 24.5, but not Emacs 25.0.95, so it seems to
have been fixed sometime in between.


This bug report was last modified 9 years and 25 days ago.

Previous Next


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