develooper Front page | perl.perl5.porters | Postings from July 2010

[perl #3643] compiler miscounts lines in s/.../.../e

Thread Previous | Thread Next
From:
George Greer via RT
Date:
July 25, 2010 16:20
Subject:
[perl #3643] compiler miscounts lines in s/.../.../e
Message ID:
rt-3.6.HEAD-11314-1280100039-1967.3643-15-0@perl.org
On Fri Aug 04 18:10:13 2000, jfriedl@yahoo-inc.com wrote:
> With versions since 5.004, this program (with line numbers shown)
> 
>        1|    $_ = "foo";
>        2|    s{
>        3|
>        4|	    f
>        5|	    o
>        6|	    o
>        7|
>        8|    }{
>        9|
>       10|	  warn "now";
>       11|	  warn "now";
>       12|	  warn "now";
>       13|
>       14|	  "FOO";
>       15|    }gex;
>       16|
>       17|    warn "now";
> 
> prints:
> 
>     now at /tmp/t3 line 4.
>     now at /tmp/t3 line 5.
>     now at /tmp/t3 line 6.
>     now at /tmp/t3 line 17.
> 
> Perl 5.003 prints what I would consider to be correct:
> 
>     now at /tmp/t3 line 10.
>     now at /tmp/t3 line 11.
>     now at /tmp/t3 line 12.
>     now at /tmp/t3 line 17.

This was an apparently intentional change in perl-5.003_26 (4fdae800)
from Chip Salzenbrg titled "Refine 'runaway string' heuristic". 'Fixing'
it is as simple as commenting out the line "PL_multi_start =
first_start;" in toke.c, although "first_start" can be removed
completely then. No tests fail as a result, although in a way I wish
there were.

I would prefer "warn" have the exact line, although there may be more
cases it changes.

Opinions?

-- 
George Greer

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About