merge trunk
[bpt/emacs.git] / src / eval.c
index c49f8e8..69483a9 100644 (file)
@@ -1690,7 +1690,6 @@ error (const char *m, ...)
   va_list ap;
   va_start (ap, m);
   verror (m, ap);
-  va_end (ap);
 }
 \f
 DEFUN ("commandp", Fcommandp, Scommandp, 1, 2, 0,
@@ -1898,7 +1897,7 @@ If LEXICAL is t, evaluate using lexical scoping.  */)
 {
   ptrdiff_t count = SPECPDL_INDEX ();
   specbind (Qinternal_interpreter_environment,
-           NILP (lexical) ? Qnil : Fcons (Qt, Qnil));
+           CONSP (lexical) || NILP (lexical) ? lexical : Fcons (Qt, Qnil));
   return unbind_to (count, eval_sub (form));
 }
 
@@ -1931,7 +1930,10 @@ eval_sub (Lisp_Object form)
     return form;
 
   QUIT;
+
+  GCPRO1 (form);
   maybe_gc ();
+  UNGCPRO;
 
   if (++lisp_eval_depth > max_lisp_eval_depth)
     {