unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: acm@muc.de, Lars Ingebrigtsen <larsi@gnus.org>,
	54990-done@debbugs.gnu.org
Subject: bug#54990: Byte compiler bug
Date: Mon, 18 Apr 2022 10:48:43 +0000	[thread overview]
Message-ID: <Yl1CCxxxwpCt3nIJ@ACM> (raw)
In-Reply-To: <C9905E51-6C93-48C7-A2C9-A7238E1BC520@acm.org>

Hello, Mattias.

On Sun, Apr 17, 2022 at 16:32:53 +0200, Mattias Engdegård wrote:
> This is related to symbol positioning so Alan should be well-placed to
> debug it. (The symbol names are irrelevant.)

I'd got just as far as identifying the merge of
scratch/correct-warning-pos as the first version containing the bug.

> 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:

Thank you for this observation.  It was _exceptionally_ helpful.

> (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 "..."]

I've committed a fix, which I'm pretty sure works, so I'm closing the bug
with this post.  Thanks again for the help!

-- 
Alan Mackenzie (Nuremberg, Germany).





  reply	other threads:[~2022-04-18 10:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-17 12:31 bug#54990: Byte compiler bug Alan Mackenzie
2022-04-17 13:02 ` Lars Ingebrigtsen
2022-04-17 13:53   ` Alan Mackenzie
2022-04-17 14:32 ` Mattias Engdegård
2022-04-18 10:48   ` Alan Mackenzie [this message]
2022-04-18 15:43     ` Mattias Engdegård
2022-04-20 19:33       ` Alan Mackenzie
2022-04-21  9:49         ` Alan Mackenzie
2022-05-02 13:45           ` Mattias Engdegård
2022-05-02 18:46             ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yl1CCxxxwpCt3nIJ@ACM \
    --to=acm@muc.de \
    --cc=54990-done@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=mattiase@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).