Subject: 25.1.50; Evaluating '((closure))' aborts Emacs

From: Andreas Politz <[email-masked]>
Date: Wed, 12 Oct 2016 12:26:24 +0200

emacs -Q

M-x ((closure)) RET

=> eval.c:2845: Emacs fatal error: assertion failed: CONSP (fun)

The function takes the (XCAR (XCDR '((closure)))), which is not a good
idea, since XCDR returns Qnil, while XCAR expects a cons. 

static Lisp_Object
funcall_lambda (Lisp_Object fun, ptrdiff_t nargs,
		register Lisp_Object *arg_vector)
{
  ....        
  if (CONSP (fun))
    {
      if (EQ (XCAR (fun), Qclosure))
	{
	  fun = XCDR (fun);	/* Drop `closure'.  */
	  lexenv = XCAR (fun);                 <============ 2845
	  CHECK_LIST_CONS (fun, fun);
	}
        ...
    }
  else ...
}

-ap