emacs-devel
[Top][All Lists]
Advanced

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

emacs lisp's bytecomp.el : byte-compile-lapcode bug report


From: Guy
Subject: emacs lisp's bytecomp.el : byte-compile-lapcode bug report
Date: Tue, 13 Jan 2004 18:17:06 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021212


A copy of the email i mailed to bytecomp.el authors.
if anyone else is able to help me, it's appreciated!


Dear Mr. Zawinski,
Dear Mr. Furuseth,

I believe that I have found a bug in the byte-compile-lapcode
routine in bytecomp.el
seems that the routine doesn't work as stand-alone routine.


When I tried to compile LAP expressions directly,
the labels lookup for goto instructions fails!
instead of producing goto instructions that point
to the correct label, it produces a goto instruction
that point to the index number of the given label.

in the next example, instead of having the goto
point to byte #10, it points to the first byte!


Example:

* bytecode created by the make-bytecode routine.
the Constants vector: [n 0 1 fact]

LAP-CODE (factorial routine):

((byte-varref n . 0)
(byte-constant 0 . 1)
(byte-eqlsign . 0)
(byte-goto-if-nil TAG 2 . 0)
(byte-constant 1 . 2)
(byte-dup . 0)
(byte-varset n . 0)
(byte-return . 0)
(TAG 2 . 0)
(byte-varref n . 0)
(byte-constant fact . 3)
(byte-varref n . 0)
(byte-sub1 . 0)
(byte-call . 1)
(byte-mult . 0)
(byte-return . 0))


            Sincerely,
                    Guy.

P.S.

try to run this buggous code:
(defalias 'fact #[(n) (byte-compile-lapcode '((byte-varref n . 0) (byte-constant 0 . 1) (byte-eqlsign . 0) (byte-goto-if-nil TAG 2 . 0) (byte-constant 1 . 2) (byte-dup . 0) (byte-varset n . 0) (byte-return . 0) (TAG 2 . 0) (byte-varref n . 0) (byte-constant fact . 3) (byte-varref n . 0) (byte-sub1 . 0) (byte-call . 1) (byte-mult . 0) (byte-return . 0)) ) [n 0 1 fact] 3])







reply via email to

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