Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #40204] line numbers of runtime errors are one too low

5 views
Skip to first unread message

Chip Salzenberg

unread,
Aug 19, 2006, 5:30:53 PM8/19/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Chip Salzenberg
# Please include the string: [perl #40204]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40204 >


Runtime errors seem to be off by one these days. Anybody play with line
numbering recently?

Given this source:

.sub foo :main
P0 = new .Hash
P1 = P0['x']
unless P1 goto no
print "yes\n"
no:
.end

The message claims line number 3:

Null PMC access in get_bool()
current instr.: 'foo' pc 7 (/tmp/line.pir:3)

Whereas the actual error is on line 4.
--
Chip Salzenberg <ch...@pobox.com>

Leopold Toetsch

unread,
Aug 19, 2006, 7:37:20 PM8/19/06
to perl6-i...@perl.org, Chip Salzenberg, bugs-bi...@rt.perl.org
Am Samstag, 19. August 2006 23:30 schrieb Chip Salzenberg:
> Runtime errors seem to be off by one these days.

Not "these days" - since a long time. There's a ticket [1] for that already.

leo

[1] http://rt.perl.org/rt3/Public/Bug/Display.html?id=38594
and WTF - who dared to close that (coke--)

Will Coleda

unread,
Aug 19, 2006, 8:43:53 PM8/19/06
to Leopold Toetsch, perl6-i...@perl.org, Chip Salzenberg, bugs-bi...@netlabs.develooper.com

This isn't the same error, it's a different one.

Given code like this:

.sub foo :main
print "hello kitty\n"
P1 = find_global 'q'
print P1
.end

we get the same failure mode in svn head and r13182, reporting the
correct line #3.

However, using something more like chip's example (can't use chips
example exactly in r13182 because None was still around then)

.sub foo :main
null P1
unless P1 goto eek
eek:
.end

We see that this fails the same way in *both*, reporting the error on
line 2. (a line early, just like chip's)

So, this is a new bug, and the old one can stay dead.

Regards.

--
Will "Coke" Coleda
wi...@coleda.com


Leopold Toetsch

unread,
Aug 20, 2006, 10:11:25 AM8/20/06
to Will Coleda, perl6-i...@perl.org, Chip Salzenberg, bugs-bi...@netlabs.develooper.com
Am Sonntag, 20. August 2006 02:43 schrieb Will Coleda:
> > [1] http://rt.perl.org/rt3/Public/Bug/Display.html?id=38594
> >     and WTF - who dared to close that (coke--)
>
> This isn't the same error, it's a different one.

Do you intend to have a new ticket for each PIR snippet with wrong line
numbers? I should have made it more clear in #38594 - the one example is just
an axample, but by far not the only one with wrong line numbers.

leo

Chip Salzenberg

unread,
Aug 20, 2006, 12:10:48 PM8/20/06
to Leopold Toetsch via RT
On Sun, Aug 20, 2006 at 07:12:12AM -0700, Leopold Toetsch via RT wrote:
> Am Sonntag, 20. August 2006 02:43 schrieb Will Coleda:
> > > [1] http://rt.perl.org/rt3/Public/Bug/Display.html?id=38594
> > >     and WTF - who dared to close that (coke--)
> >
> > This isn't the same error, it's a different one.
>
> Do you intend to have a new ticket for each PIR snippet with wrong line
> numbers?

If too many RT tickets is our largest problem then ... well, anyway, it's
not.

When the apparent & reported bug was fixed, closing the ticket was
right. Besides, it's not like they aren't a renewable resource. :-)
--
Chip Salzenberg <ch...@pobox.com>

0 new messages