GNU bug report logs - #54990
Byte compiler bug

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Sun, 17 Apr 2022 12:59:02 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mattias EngdegÄrd <mattiase <at> acm.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 54990 <at> debbugs.gnu.org
Subject: bug#54990: Byte compiler bug
Date: Sun, 17 Apr 2022 16:32:53 +0200
This is related to symbol positioning so Alan should be well-placed to debug it. (The symbol names are irrelevant.)

It's `compile-defun` that is broken; the constant vector of the resulting bytecode contains symbols with position as hash table keys for a switch operation. Compare the bytecode object with that from `byte-compile` which works correctly:

(defun tata (x)
  (cond
   ((eq x 'a) 'toto)
   ((eq x 'b) 'titi)))

(byte-compile 'tata)
=>
#[257 "..." [#s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (a 6 b 8)) toto titi nil] 3 "..."]

;; if using `compile-defun` on `tata`:
(symbol-function 'tata)
#[257 "..." [#s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (#<symbol a at 293> 6 #<symbol b at 314> 8)) toto titi nil] 3 "..."]





This bug report was last modified 3 years and 81 days ago.

Previous Next


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