GNU bug report logs - #4264
23.1.50; byte-compile-lapcode broken

Previous Next

Package: emacs;

Reported by: jpff <jpff <at> codemist.co.uk>

Date: Wed, 26 Aug 2009 05:10:05 UTC

Severity: normal

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4264 in the body.
You can then email your comments to 4264 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4264; Package emacs. (Wed, 26 Aug 2009 05:10:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to jpff <jpff <at> codemist.co.uk>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 26 Aug 2009 05:10:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: jpff <jpff <at> codemist.co.uk>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.1.50; byte-compile-lapcode broken
Date: Wed, 26 Aug 2009 06:01:52 +0100
if lisp/emacs-lisp/bytecomp.el, function
(defun byte-compile-lapcode (lap)

has its brackets all wrong, leading to bytes falling out of scope
I think it should read
    (let (bytes)
      (while patchlist
	(setq bytes (car patchlist))
	(cond ((atom (car bytes)))	; Tag
	      (t			; Absolute jump
	       (setq pc (car (cdr (car bytes))))	; Pick PC from tag
	       (setcar (cdr bytes) (logand pc 255))
	       (setcar bytes (lsh pc -8))
               ;; FIXME: Replace this by some workaround.
               (if (> (car bytes) 255) (error "Bytecode overflow")))))
      (setq patchlist (cdr patchlist))
      (apply 'unibyte-string (nreverse bytes)))))

but I am having trouble checking


In GNU Emacs 23.1.50.54 (x86_64-unknown-linux-gnu, GTK+ Version 2.14.4)
 of 2009-08-26 on harvey
Windowing system distributor `The X.Org Foundation', version 11.0.10502000
configured using `configure  '--with-gif=no''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  eldoc-mode: t
  auto-image-file-mode: t
  show-paren-mode: t
  display-time-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x C-f G N U <tab> e m a c s - <tab> 2 2 <tab> l i 
s <tab> / e m a <tab> i <tab> b y t e c <tab> <return> 
C-u 8 6 0 C-n <down> <up> <up> <up> <up> <up> <up> 
<up> <up> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <right> <down> <escape> C-f 
<down> <down> <left> <escape> C-b q <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <down> <down> <down> <tab> <down> <down> 
<tab> <down> <tab> <down> <tab> <down> <tab> <down> 
<tab> <down> <tab> <down> <tab> <down> <tab> <down> 
<tab> <down> <tab> <down> <tab> <up> C-e <backspace> 
<down> <tab> <down> <tab> <up> <down> <right> <right> 
<right> <right> <right> <escape> C-b <escape> C-f C-d 
C-x C-s y <left> <left> <left> <left> <left> <left> 
<left> <left> C-s C-w C-l C-l C-l C-s 1 C-x 1 C-l C-l 
C-x C-x C-a C-l C-l C-l <tab> <up> <tab> <down> <left> 
<left> <backspace> <tab> <right> <backspace> <tab> 
<down> <tab> <right> <right> <right> <right> <right> 
) ) C-x C-s y M-v M-v <down-mouse-1> <mouse-movement> 
<mouse-movement> <drag-mouse-1> M-m r C-g C-x k <return> 
M-x r e p <tab> o <tab> r t <tab> <return>

Recent messages:
Mark saved where search started [2 times]
Saving file /home/jpff/GNU_21/emacs-22.0.50/lisp/emacs-lisp/bytecomp.el...
Wrote /home/jpff/GNU_21/emacs-22.0.50/lisp/emacs-lisp/bytecomp.el
Byte-compile /home/jpff/GNU_21/emacs-22.0.50/lisp/emacs-lisp/bytecomp.el? (y or n) 
Compiling /home/jpff/GNU_21/emacs-22.0.50/lisp/emacs-lisp/bytecomp.el...done
Wrote /home/jpff/GNU_21/emacs-22.0.50/lisp/emacs-lisp/bytecomp.elc
Loading mail-extr...done
Parsing /home/jpff/.mailrc... done
Quit
Making completion list... [2 times]

Load-path shadows:
/home/jpff/GNU_21/local-lisp/t-mouse hides /home/jpff/GNU_21/emacs-22.0.50/lisp/t-mouse
/home/jpff/GNU_21/local-lisp/emerge hides /home/jpff/GNU_21/emacs-22.0.50/lisp/emerge
/home/jpff/GNU_21/local-lisp/scroll-lock hides /home/jpff/GNU_21/emacs-22.0.50/lisp/scroll-lock
/home/jpff/GNU_21/local-lisp/ruler-mode hides /home/jpff/GNU_21/emacs-22.0.50/lisp/ruler-mode
/home/jpff/GNU_21/local-lisp/url hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url
/home/jpff/GNU_21/local-lisp/url-parse hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-parse
/home/jpff/GNU_21/local-lisp/url-cache hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-cache
/home/jpff/GNU_21/local-lisp/url-file hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-file
/home/jpff/GNU_21/local-lisp/url-misc hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-misc
/home/jpff/GNU_21/local-lisp/url-vars hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-vars
/home/jpff/GNU_21/local-lisp/url-ns hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-ns
/home/jpff/GNU_21/local-lisp/url-cookie hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-cookie
/home/jpff/GNU_21/local-lisp/url-irc hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-irc
/home/jpff/GNU_21/local-lisp/url-gw hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-gw
/home/jpff/GNU_21/local-lisp/url-ldap hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-ldap
/home/jpff/GNU_21/local-lisp/url-http hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-http
/home/jpff/GNU_21/local-lisp/url-nfs hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-nfs
/home/jpff/GNU_21/local-lisp/url-auth hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-auth
/home/jpff/GNU_21/local-lisp/url-cid hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-cid
/home/jpff/GNU_21/local-lisp/url-news hides /home/jpff/GNU_21/emacs-22.0.50/lisp/url/url-news
/home/jpff/GNU_21/local-lisp/remember hides /home/jpff/GNU_21/emacs-22.0.50/lisp/textmodes/remember
/home/jpff/GNU_21/local-lisp/socks hides /home/jpff/GNU_21/emacs-22.0.50/lisp/net/socks
/home/jpff/GNU_21/emacs-22.0.50/lisp/vc-mcvs hides /home/jpff/GNU_21/emacs-22.0.50/lisp/obsolete/vc-mcvs
/home/jpff/GNU_21/emacs-22.0.50/lisp/resume hides /home/jpff/GNU_21/emacs-22.0.50/lisp/obsolete/resume

==John ffitch



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4264; Package emacs. (Wed, 26 Aug 2009 05:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to jpff <jpff <at> codemist.co.uk>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 26 Aug 2009 05:45:03 GMT) Full text and rfc822 format available.

Message #10 received at 4264 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: jpff <jpff <at> codemist.co.uk>
To: 4264 <at> debbugs.gnu.org
Subject: correction
Date: Wed, 26 Aug 2009 06:36:58 +0100
That function should be as below -- at least it works this way
==John ffitch

(defun byte-compile-lapcode (lap)
  "Turns lapcode into bytecode.  The lapcode is destroyed."
  ;; Lapcode modifications: changes the ID of a tag to be the tag's PC.
  (let ((pc 0)			; Program counter
	op off			; Operation & offset
	(bytes '())		; Put the output bytes here
	(patchlist nil))	; List of tags and goto's to patch
    (while lap
      (setq op (car (car lap))
	    off (cdr (car lap)))
      (cond ((not (symbolp op))
	     (error "Non-symbolic opcode `%s'" op))
	    ((eq op 'TAG)
	     (setcar off pc)
	     (setq patchlist (cons off patchlist)))
	    ((memq op byte-goto-ops)
	     (setq pc (+ pc 3))
	     (setq bytes (cons (cons pc (cdr off))
			       (cons nil
				     (cons (symbol-value op) bytes))))
	     (setq patchlist (cons bytes patchlist)))
	    (t
	     (setq bytes
		   (cond ((cond ((consp off)
				 ;; Variable or constant reference
				 (setq off (cdr off))
				 (eq op 'byte-constant)))
			  (cond ((< off byte-constant-limit)
				 (setq pc (1+ pc))
				 (cons (+ byte-constant off) bytes))
				(t
				 (setq pc (+ 3 pc))
				 (cons (lsh off -8)
				       (cons (logand off 255)
					     (cons byte-constant2 bytes))))))
			 ((<= byte-listN (symbol-value op))
			  (setq pc (+ 2 pc))
			  (cons off (cons (symbol-value op) bytes)))
			 ((< off 6)
			  (setq pc (1+ pc))
			  (cons (+ (symbol-value op) off) bytes))
			 ((< off 256)
			  (setq pc (+ 2 pc))
			  (cons off (cons (+ (symbol-value op) 6) bytes)))
			 (t
			  (setq pc (+ 3 pc))
			  (cons (lsh off -8)
				(cons (logand off 255)
				      (cons (+ (symbol-value op) 7)
					    bytes))))))))
      (setq lap (cdr lap)))
    ;;(if (not (= pc (length bytes)))
    ;;    (error "Compiler error: pc mismatch - %s %s" pc (length bytes)))
    ;; Patch PC into jumps
    (let (bytes)
      (while patchlist
	(setq bytes (car patchlist))
	(cond ((atom (car bytes)))	; Tag
	      (t			; Absolute jump
	       (setq pc (car (cdr (car bytes))))	; Pick PC from tag
	       (setcar (cdr bytes) (logand pc 255))
	       (setcar bytes (lsh pc -8))
               ;; FIXME: Replace this by some workaround.
               (if (> (car bytes) 255) (error "Bytecode overflow"))))
        (setq patchlist (cdr patchlist))))
    (apply 'unibyte-string (nreverse bytes))))



Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Wed, 26 Aug 2009 16:35:22 GMT) Full text and rfc822 format available.

Notification sent to jpff <jpff <at> codemist.co.uk>:
bug acknowledged by developer. (Wed, 26 Aug 2009 16:35:24 GMT) Full text and rfc822 format available.

Message #15 received at 4264-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 4264-done <at> debbugs.gnu.org
Subject: Re: bug#4264: 23.1.50; byte-compile-lapcode broken
Date: Wed, 26 Aug 2009 12:30:49 -0400
2009-08-26  Stefan Monnier  <monnier <at> iro.umontreal.ca>

        * emacs-lisp/bytecomp.el (byte-compile-lapcode): Fix up last change.

BTW, INSTALL.CVS says:

    Because the CVS version of Emacs is a work in progress, it will
    sometimes fail to build. Please wait a day or so (and check the
    bug and development mailing list archives) before reporting such
    problems. In most cases, the problem is known about and is just
    waiting for someone to fix it.



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Thu, 24 Sep 2009 14:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 328 days ago.

Previous Next


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