Problem reported by Glenn Morris in:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00946.html
* src/floatfns.c (Fexpt):
* src/xselect.c (cons_to_x_long):
Don't assume Lisp_Object values are scalars.
/* Common Lisp spec: don't promote if both are integers, and if the
result is not fractional. */
- if (INTEGERP (arg1) && Fnatnump (arg2))
+ if (INTEGERP (arg1) && !NILP (Fnatnump (arg2)))
return expt_integer (arg1, arg2);
return make_float (pow (XFLOATINT (arg1), XFLOATINT (arg2)));
cons_to_x_long (Lisp_Object obj)
{
if (X_ULONG_MAX <= INTMAX_MAX
- || !Fnatnump (CONSP (obj) ? XCAR (obj) : obj))
+ || NILP (Fnatnump (CONSP (obj) ? XCAR (obj) : obj)))
return cons_to_signed (obj, X_LONG_MIN, min (X_ULONG_MAX, INTMAX_MAX));
else
return cons_to_unsigned (obj, X_ULONG_MAX);