summaryrefslogtreecommitdiff
path: root/lisp/calc
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-03-27 18:11:18 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2020-03-27 18:11:18 +0100
commitc2b8ce4439935e2e158d4357d234135a251c5767 (patch)
tree982b300e317a12e9d8952e5317dcf755890f7314 /lisp/calc
parente1f0e0892232221e6333b24788b97942c83ec738 (diff)
downloademacs-c2b8ce4439935e2e158d4357d234135a251c5767.tar.gz
emacs-c2b8ce4439935e2e158d4357d234135a251c5767.tar.bz2
emacs-c2b8ce4439935e2e158d4357d234135a251c5767.zip
Calc: don't treat nil as an integer (bug#40155)
Make Math-num-integerp return false for nil, following Math-integerp which was changed in the bignum reform. This fixes a crash in calc-graph-fast. Reported by Narendra Joshi. * lisp/calc/calc-macs.el (Math-num-integerp): Not true for nil. * test/lisp/calc/calc-tests.el (calc-Math-integerp): New tests.
Diffstat (limited to 'lisp/calc')
-rw-r--r--lisp/calc/calc-macs.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/calc/calc-macs.el b/lisp/calc/calc-macs.el
index e73d108e6d9..257d369b87a 100644
--- a/lisp/calc/calc-macs.el
+++ b/lisp/calc/calc-macs.el
@@ -161,8 +161,9 @@
hms date mod var))))
(defsubst Math-num-integerp (a)
- (or (not (consp a))
- (and (eq (car a) 'float)
+ (or (integerp a)
+ (and (consp a)
+ (eq (car a) 'float)
(>= (nth 2 a) 0))))
(defsubst Math-equal-int (a b)