emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#34757: closed (Invalid bytecode from byte compiler


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#34757: closed (Invalid bytecode from byte compiler)
Date: Sat, 27 Jul 2019 21:31:02 +0000

Your message dated Sat, 27 Jul 2019 17:30:03 -0400
with message-id <address@hidden>
and subject line Re: bug#34757: Invalid bytecode from byte compiler
has caused the debbugs.gnu.org bug report #34757,
regarding Invalid bytecode from byte compiler
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden.)


-- 
34757: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34757
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Invalid bytecode from byte compiler Date: Tue, 5 Mar 2019 17:01:00 +0900 User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Thunderbird/60.5.2
Invalid bytecode is output and error occurs when executed.

Byte compile the following code.

bug.el
----------------------------------------------------------------
;;; -*- lexical-binding: t; -*-

(let ((a 2))
  (print 1)
  (setq a 1))
----------------------------------------------------------------

$ emacs --batch -f batch-byte-compile bug.el

bug.elc
----------------------------------------------------------------
;ELC
...
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(funcall 2 'print 1)
1
----------------------------------------------------------------

$ emacs --batch -l bug.elc
Invalid function: 2

It occurs in versions 25.2, 26.1 and HEAD.



--- End Message ---
--- Begin Message --- Subject: Re: bug#34757: Invalid bytecode from byte compiler Date: Sat, 27 Jul 2019 17:30:03 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
> We could fix byte-compile-out-toplevel to properly analyze how many
> stack arguments the call takes, but this patch simply treats forms
> like this as nontrivial:
>
> diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
> index 0b8f8824b4c..4e54e08ce14 100644
> --- a/lisp/emacs-lisp/bytecomp.el
> +++ b/lisp/emacs-lisp/bytecomp.el
> @@ -3025,6 +3025,7 @@ byte-compile-out-toplevel
>                         (or (null (cdr rest))
>                             (and (memq output-type '(file progn t))
>                                  (cdr (cdr rest))
> +                                (eql (length body) (cdr (car rest)))
>                                  (eq (car (nth 1 rest)) 'byte-discard)
>                                  (progn (setq rest (cdr rest)) t))))
>                    (setq maycall nil)    ; Only allow one real function call.

I installed this fix for now.


        Stefan



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]