GNU bug report logs - #20241
25.0.50; `setq' with only one argument

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Wed, 1 Apr 2015 14:54:02 UTC

Severity: wishlist

Found in version 25.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


Message #118 received at 20241 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Andreas Schwab <schwab <at> suse.de>
Cc: John Wiegley <jwiegley <at> gmail.com>, 20241 <at> debbugs.gnu.org,
 Artur Malabarba <bruce.connor.am <at> gmail.com>,
 Johan Bockgård <bojohan <at> gnu.org>
Subject: Re: bug#20241: 25.0.50; `setq' with only one argument
Date: Thu, 26 Nov 2015 12:06:19 +0000
Hello, Andreas.

On Thu, Nov 26, 2015 at 09:58:39AM +0100, Andreas Schwab wrote:
> Johan Bockgård <bojohan <at> gnu.org> writes:

> > (funcall) (print t)

> > Compile. Load .elc =>

> > This consistently gives me one of two results:
> > A segfault, or "Invalid function: 183795961" where the actual
> > number depends on the timestamp of the .elc file.

> That's a bug in the byte compiler, it shouldn't generate call 0 without
> an operand on the stack.

Try the following fix:


diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index ffe73de..842e73d 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -4012,8 +4012,12 @@ byte-compile-while
     (setq byte-compile--for-effect nil)))
 
 (defun byte-compile-funcall (form)
-  (mapc 'byte-compile-form (cdr form))
-  (byte-compile-out 'byte-call (length (cdr (cdr form)))))
+  (if (cdr form)
+      (progn
+        (mapc 'byte-compile-form (cdr form))
+        (byte-compile-out 'byte-call (length (cdr (cdr form)))))
+    (byte-compile-log-warning "`funcall' called with no arguments" nil :error)
+    (byte-compile-form '(signal 'wrong-number-of-arguments '(funcall 0)))))
 
 
 ;; let binding


> Andreas.

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 9 years and 238 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.