From xemacs-m  Thu Mar 20 23:51:07 1997
Received: from crystal.WonderWorks.COM (crystal.WonderWorks.com [192.203.206.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id XAA29856
	for <xemacs-beta@xemacs.org>; Thu, 20 Mar 1997 23:51:05 -0600 (CST)
Received: by crystal.WonderWorks.COM 
	id QQchud12368; Fri, 21 Mar 1997 00:51:06 -0500 (EST)
Date: Fri, 21 Mar 1997 00:51:06 -0500 (EST)
Message-Id: <QQchud12368.199703210551@crystal.WonderWorks.COM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Kyle Jones <kyle_jones@wonderworks.com>
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: [PATCH] for 20.1-b8 `M-x disassemble' not working?
In-Reply-To: <kighgi6rn6h.fsf@jagor.srce.hr>
References: <kighgi6rn6h.fsf@jagor.srce.hr>
X-Mailer: VM 6.21 under 20.1 XEmacs Lucid (beta8)
X-Face: /cA45WHG7jWq>(O3&Z57Y<"WsX5ddc,4c#w0F*zrV#=M
        0@~@,s;b,aMtR5Sqs"+nU.z^CSFQ9t`z2>W,S,]:[+2^
        Nbf6v4g>!&,7R4Ot4Wg{&tm=WX7P["9%a)_da48-^tGy
        ,qz]Z,Zz\{E.,]'EO+F)@$KtF&V

Hrvoje Niksic writes:
 > I find this intolerable

Righteous fire! :)

 > -- disassemble doesn't seem to work in XEmacs 20 (compiled with
 > MULE, but I don't think it matters, since the error is in
 > char<->int troubles).  The trouble spot is using
 > `int-to-string' on characters in `disassemble-1'. Simply
 > changing the three occurences of `int-to-string' to
 > `char-to-string' doesn't help matters, as then you get things
 > like `call ^A' instead of `call 1', etc.

Try this patch.

*** 1.1	1997/03/21 05:33:29
--- lisp/bytecomp/byte-optimize.el	1997/03/21 05:38:34
***************
*** 1173,1179 ****
  	   (setq op (logand op 248))
  	   (cond ((eq tem 6)
  		  (setq ptr (1+ ptr))	;offset in next byte
! 		  (aref bytes ptr))
  		 ((eq tem 7)
  		  (setq ptr (1+ ptr))	;offset in next 2 bytes
  		  (+ (aref bytes ptr)
--- 1173,1183 ----
  	   (setq op (logand op 248))
  	   (cond ((eq tem 6)
  		  (setq ptr (1+ ptr))	;offset in next byte
! 		  ;; char-to-int to avoid downstream problems
! 		  ;; caused by chars appearing where ints are
! 		  ;; expected.  In bytecode the bytes in the
! 		  ;; opcode string are always interpreted as ints.
! 		  (char-to-int (aref bytes ptr)))
  		 ((eq tem 7)
  		  (setq ptr (1+ ptr))	;offset in next 2 bytes
  		  (+ (aref bytes ptr)
***************
*** 1197,1203 ****
  	((and (>= op byte-rel-goto)
  	      (<= op byte-insertN))
  	 (setq ptr (1+ ptr))		;offset in next byte
! 	 (aref bytes ptr))))
  
  
  ;;; This de-compiler is used for inline expansion of compiled functions,
--- 1201,1211 ----
  	((and (>= op byte-rel-goto)
  	      (<= op byte-insertN))
  	 (setq ptr (1+ ptr))		;offset in next byte
! 	 ;; Use char-to-int to avoid downstream problems caused by
! 	 ;; chars appearing where ints are expected.  In bytecode
! 	 ;; the bytes in the opcode string are always interpreted as
! 	 ;; ints.
! 	 (char-to-int (aref bytes ptr)))))
  
  
  ;;; This de-compiler is used for inline expansion of compiled functions,

