]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix assertion-violations on non-integers
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 31 Dec 2018 03:00:09 +0000 (19:00 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 31 Dec 2018 03:00:46 +0000 (19:00 -0800)
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.

src/data.c
src/xdisp.c

index c64adb6635e39398e2342f8ff13a35dbe446f2af..4ea71cea5d26e7bb43999f0eb59748400f2b2b28 100644 (file)
@@ -2655,7 +2655,7 @@ cons_to_unsigned (Lisp_Object c, uintmax_t max)
   else
     {
       Lisp_Object hi = CONSP (c) ? XCAR (c) : c;
-      valid = integer_to_uintmax (hi, &val);
+      valid = INTEGERP (hi) && integer_to_uintmax (hi, &val);
 
       if (valid && CONSP (c))
        {
@@ -2716,7 +2716,7 @@ cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max)
   else
     {
       Lisp_Object hi = CONSP (c) ? XCAR (c) : c;
-      valid = integer_to_intmax (hi, &val);
+      valid = INTEGERP (hi) && integer_to_intmax (hi, &val);
 
       if (valid && CONSP (c))
        {
index 65a61a0120cf1fdd66f80d15128428f5c12ce6da..4cb10503e602cadc52fb31da9230b698d89d9ce2 100644 (file)
@@ -27991,7 +27991,7 @@ calc_line_height_property (struct it *it, Lisp_Object val, struct font *font,
   /* FIXME: Check for overflow in multiplication or conversion.  */
   if (FLOATP (val))
     height = (int)(XFLOAT_DATA (val) * height);
-  else
+  else if (INTEGERP (val))
     {
       intmax_t v;
       if (integer_to_intmax (val, &v))