Article View: gnu.emacs.bug
Article #99815Re: byte-compiling problem (18.54.3)
From: Tim Bradshaw
Date: Fri, 11 May 1990 03:14
Date: Fri, 11 May 1990 03:14
47 lines
2333 bytes
2333 bytes
In article <JGREELY.90May10033656@oz.cis.ohio-state.edu> jgreely@oz.cis.ohio-state.edu (J Greely) writes:
> Ran into what looks like a bug in the byte-compiling functions. The
> following function returns t unless it's byte-compiled (I think this
> is a minimal test-case :-)):
>
> (defun generate-bad-byte-code ()
> (cond (t)))
>
> Disassembling it returns the following:
>
> byte code for generate-bad-byte-code:
> args: nil
>
> 0 constant nil
> 1 return
For 18.55, the following fixes this & gives the behaviour documented in
Steele (I don't have the Elisp ref manual which is what it *should*
agree with!).
[diff -c bytecomp.el-orig bytecomp.el]
*** bytecomp.el-orig Fri May 11 02:50:31 1990
--- bytecomp.el Fri May 11 03:03:47 1990
***************
*** 944,950 ****
(if (or (eq (car (car clauses)) t)
(eq (car-safe (car (car clauses))) 'quote))
;; Unconditional clause
! (byte-compile-body (cdr (car clauses)))
(if (null (cdr clauses))
;; Only one clause
(let ((donetag (byte-compile-make-tag)))
--- 944,951 ----
(if (or (eq (car (car clauses)) t)
(eq (car-safe (car (car clauses))) 'quote))
;; Unconditional clause
! ;; Handle case of (t) correctly
! (byte-compile-body (or (cdr (car clauses)) (car clauses)))
(if (null (cdr clauses))
;; Only one clause
(let ((donetag (byte-compile-make-tag)))
--tim
Tim Bradshaw. ARPA: tim%ed.cstr@nsfnet-relay.ac.uk
UUCP: ...!uunet!mcvax!ukc!cstr!tim JANET: tim@uk.ac.ed.cstr
"Quis custodiet ipsos custodes?"
Technical Details
Message-ID:
<TIM.90May11031411@watt.cstr.ed.ac.uk>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!ukc!edcastle!aipna!cstr!timReferences:
<JGREELY.90May10033656@oz.cis.ohio-state.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,79f06c91f83ac4ee X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-05-11 06:39:16 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!ukc!edcastle!aipna!cstr!tim From: tim@cstr.ed.ac.uk (Tim Bradshaw) Newsgroups: gnu.emacs.bug Subject: Re: byte-compiling problem (18.54.3) Message-ID: <TIM.90May11031411@watt.cstr.ed.ac.uk> Date: 11 May 90 03:14:11 GMT References: <JGREELY.90May10033656@oz.cis.ohio-state.edu> Sender: news@aipna.ed.ac.uk Distribution: gnu Organization: CSTR, University of Edinburgh Lines: 47 Posted: Fri May 11 04:14:11 1990 In-reply-to: jgreely@oz.cis.ohio-state.edu's message of 10 May 90 07:36:56 GMT