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@debbugs.gnu.org
Subject: bug#54990: Byte compiler bug
Date: Mon, 2 May 2022 18:46:45 +0000	[thread overview]
Message-ID: <YnAnFQwf6vUig8eS@ACM> (raw)
In-Reply-To: <DFD59B3A-87E9-4871-AB1E-2689E20FF45F@acm.org>

Hello, Mattias.

On Mon, May 02, 2022 at 15:45:25 +0200, Mattias Engdegård wrote:
> 21 apr. 2022 kl. 11.49 skrev Alan Mackenzie <acm@muc.de>:

> > This is now clear.  byte-compile is compiling a form, not source code,
> > so unless the form was read with symbol positions, it won't have them.
> > In byte-compile-file, symbol positions are stripped as the byte code
> > gets output to the file.elc.  So the symbol positions were not in the
> > ..elc.

> > Only in compile-defun were there positions, and they "survived".

> Thank you for dealing with this. My next question would be why the bug
> only affected switch hash table keys and no other constants. Do you
> know?

The handling of a cond form which compiles to a hash table is anamolous.
This table is essentially byte code, yet is created in an early phase of
the compilation, when symbols still have their positions.  So these
positions have to be handled specially.  Other forms are converted to
byte code in a later phase of the compiler, when (nearly) all symbols
have their positions stripped.

> And why did you decide to strip the keys at that point (lowering from
> LAP), and not where other constants are stripped?

To be honest, I can't really remember; I might not have been aware of any
anomaly, here.  As a general principle, the positions on symbols are
preserved as long as possible, in case a warning message is yet to be
output.

> I see that you have committed more corrections since; were these
> related?

No, they were not.  They were to do with other problems.

-- 
Alan Mackenzie (Nuremberg, Germany).





      reply	other threads:[~2022-05-02 18:46 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
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 [this message]

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=YnAnFQwf6vUig8eS@ACM \
    --to=acm@muc.de \
    --cc=54990@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).