unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* emacs lisp's bytecomp.el  :  byte-compile-lapcode bug report
@ 2004-01-13 16:17 Guy
  0 siblings, 0 replies; only message in thread
From: Guy @ 2004-01-13 16:17 UTC (permalink / raw)



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])

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-01-13 16:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-13 16:17 emacs lisp's bytecomp.el : byte-compile-lapcode bug report Guy

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).