unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: luke.yx.lee@gmail.com
Cc: 17681@debbugs.gnu.org, David Engster <deng@randomsample.de>
Subject: bug#17681: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators
Date: Thu, 05 Jun 2014 18:26:15 -0400	[thread overview]
Message-ID: <c6tx7zxabc.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <87zjhtn6xq.fsf@engster.org> (David Engster's message of "Tue, 03 Jun 2014 21:12:33 +0200")


Luke, could you take a look at this report please?

http://debbugs.gnu.org/17681

An artificial but smaller example might be:

#if 1 / FOO
#endif


David Engster wrote:

> 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.





  reply	other threads:[~2014-06-05 22:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03 19:12 bug#17681: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators David Engster
2014-06-05 22:26 ` Glenn Morris [this message]
2014-06-06  1:04   ` Stefan Monnier
2014-06-06  6:00     ` Luke Lee
2014-06-06  7:17       ` Glenn Morris
2014-06-06 11:11         ` Luke Lee
2014-06-06 15:19           ` Glenn Morris
2016-06-26  4:53 ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6tx7zxabc.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=17681@debbugs.gnu.org \
    --cc=deng@randomsample.de \
    --cc=luke.yx.lee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).