aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2018-12-30 19:00:09 -0800
committerPaul Eggert2018-12-30 19:00:46 -0800
commitbed56428a6e767d68a974f5ad81bebf035eb44f4 (patch)
treef6ad2c06068aedb94391920993fe96220124f82f /src
parent433b6a74ec73608ff06106daee4f53c5175d5297 (diff)
downloademacs-bed56428a6e767d68a974f5ad81bebf035eb44f4.tar.gz
emacs-bed56428a6e767d68a974f5ad81bebf035eb44f4.zip
Fix assertion-violations on non-integers
These bugs were introduced after bignums were added. * src/data.c (cons_to_unsigned, cons_to_signed): * src/xdisp.c (calc_line_height_property): Invoke integer_to_intmax and integer_to_uintmax only on integers.
Diffstat (limited to 'src')
-rw-r--r--src/data.c4
-rw-r--r--src/xdisp.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/data.c b/src/data.c
index c64adb6635e..4ea71cea5d2 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2655,7 +2655,7 @@ cons_to_unsigned (Lisp_Object c, uintmax_t max)
2655 else 2655 else
2656 { 2656 {
2657 Lisp_Object hi = CONSP (c) ? XCAR (c) : c; 2657 Lisp_Object hi = CONSP (c) ? XCAR (c) : c;
2658 valid = integer_to_uintmax (hi, &val); 2658 valid = INTEGERP (hi) && integer_to_uintmax (hi, &val);
2659 2659
2660 if (valid && CONSP (c)) 2660 if (valid && CONSP (c))
2661 { 2661 {
@@ -2716,7 +2716,7 @@ cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max)
2716 else 2716 else
2717 { 2717 {
2718 Lisp_Object hi = CONSP (c) ? XCAR (c) : c; 2718 Lisp_Object hi = CONSP (c) ? XCAR (c) : c;
2719 valid = integer_to_intmax (hi, &val); 2719 valid = INTEGERP (hi) && integer_to_intmax (hi, &val);
2720 2720
2721 if (valid && CONSP (c)) 2721 if (valid && CONSP (c))
2722 { 2722 {
diff --git a/src/xdisp.c b/src/xdisp.c
index 65a61a0120c..4cb10503e60 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -27991,7 +27991,7 @@ calc_line_height_property (struct it *it, Lisp_Object val, struct font *font,
27991 /* FIXME: Check for overflow in multiplication or conversion. */ 27991 /* FIXME: Check for overflow in multiplication or conversion. */
27992 if (FLOATP (val)) 27992 if (FLOATP (val))
27993 height = (int)(XFLOAT_DATA (val) * height); 27993 height = (int)(XFLOAT_DATA (val) * height);
27994 else 27994 else if (INTEGERP (val))
27995 { 27995 {
27996 intmax_t v; 27996 intmax_t v;
27997 if (integer_to_intmax (val, &v)) 27997 if (integer_to_intmax (val, &v))