GNU bug report logs - #24449
Emacs 25.1 RC2: Byte compiler reports error in wrong place.

Previous Next

Package: emacs;

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

Date: Fri, 16 Sep 2016 11:33:01 UTC

Severity: minor

Found in versions 23.0.91, 23.3.1, 24.0.50, 24.3.1, 25.0.50, 25.1

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

Bug is archived. No further changes may be made.

Full log


Message #17 received at 24449 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 24449 <at> debbugs.gnu.org
Subject: Re: bug#24449: Emacs 25.1 RC2: Byte compiler reports error in wrong
 place.
Date: Fri, 16 Sep 2016 16:08:33 +0000
Hello, Eli.

On Fri, Sep 16, 2016 at 06:09:38PM +0300, Eli Zaretskii wrote:
> > Date: Fri, 16 Sep 2016 13:33:52 +0000
> > Cc: 24449 <at> debbugs.gnu.org
> > From: Alan Mackenzie <acm <at> muc.de>

> > > If you didn't, you should, because after you do, you will never again
> > > wonder why an incorrect line number is reported.  In fact, now that I
> > > did look there, I'm surprised it reports a correct line number at all,
> > > let alone as often as it does.  It's sheer luck.

> > This is not a Good Thing.  Even its own comment describes itself as a
> > "gross hack".  Surely we can do better?

> I certainly hope we can.  But, unless I misunderstood something, the
> way it's designed makes that really hard.

Yes.  I understand it better now, though the comments before
`byte-compile-set-symbol-position' are not as helpful as they might be.

Given that the byte compiler works by first reading an entire top-level
form, and only then going to work on it, the only handle the compiler
has on the original source is this list `read-symbol-positions-list'
produced by the reader.  (It was probably invented for the byte
compiler).

So without rewriting one or both of the byte compiler and the reader,
there doesn't seem to be a different strategy available for determining
the position in the raw source.  Correction: there might be: On
processing a symbol, at the moment the earliest occurrence of that
symbol in `read-symbol-positions-list' is removed from it.  Instead, we
could remove everything up to and including that symbol.  Maybe.

What I'm guessing happened in my particular case is that several
instances of 'eq in that list failed to get removed because it's a
function that undergoes compiler optimisation.  Or something like that.

So, the thing for me to check first is that
`byte-compile-set-symbol-position' gets called for _everything_ it
should be.

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 8 years and 309 days ago.

Previous Next


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