all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#17681: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators
@ 2014-06-03 19:12 David Engster
  2014-06-05 22:26 ` Glenn Morris
  2016-06-26  4:53 ` Noam Postavsky
  0 siblings, 2 replies; 8+ messages in thread
From: David Engster @ 2014-06-03 19:12 UTC (permalink / raw)
  To: 17681

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





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-06-26  4:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.