nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

local $/ in BEGIN block does not revert. #306

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
tested against release branch

This breaks with a simple BEGIN block.
$>perlcc -O3 -r -e 'BEGIN { local $/} print ($/ eq "\n" ? "ok" : "not ok"); 
print "\n"'
not ok

But also breaks when a sub is called from a BEGIN block, which is probably my 
issue even if I can't find it.

$>perlcc -O3 -r -e 'package bar; sub foo { print ($/ eq "\n" ? "ok" : "not 
ok"); print "\n"} sub bar { local $/;} ; package main; BEGIN { local $/} 
bar::foo();'
not ok

Original issue reported on code.google.com by todd.e.rinaldo on 21 Mar 2014 at 7:34

GoogleCodeExporter commented 9 years ago
This is a critical issue we need resolved.

Original comment by todd.e.rinaldo on 21 Mar 2014 at 7:35

GoogleCodeExporter commented 9 years ago
bad initial example. here you go.

$>perlcc -O3 -r -e 'package foo; sub check_dol_slash { print ($/ eq "\n" ? "ok" 
: "not ok") ; print  "\n"} sub begin_local { local $/;} ; package main; BEGIN { 
foo::begin_local() }  foo::check_dol_slash();'
not ok

Original comment by todd.e.rinaldo on 21 Mar 2014 at 7:37

GoogleCodeExporter commented 9 years ago
Fixed with commit 659b5d78eed870984fda8065569c8784276af8fe
Author: Reini Urban <rurban@cpanel.net>
Date:   Thu Apr 3 13:10:00 2014 -0500

assoc special SV syms, fixes #306 $/

    $, => PL_ofsgv
    $\ => PL_ors_sv
    $/ => PL_rs
    $@ => PL_errors

    This list might not be complete yet

Original comment by reini.urban on 3 Apr 2014 at 6:12

GoogleCodeExporter commented 9 years ago
This should have been caught with t/issue256.t. Adding testcase there.

Original comment by reini.urban on 3 Apr 2014 at 6:15

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Fixed with commit 063ca758a163919eaa348a03e967e809921421f8
Author: Reini Urban <rurban@cpanel.net>
Date:   Thu Apr 3 13:10:00 2014 -0500

Original comment by reini.urban on 3 Apr 2014 at 6:50

GoogleCodeExporter commented 9 years ago
Reopening. It caused a regression with t/CORE/io/print.t and probably the other 
failing core tests also.

bisected to commit 063ca758a1

$ perl5.14.4-nt -Mblib script/perlcc -r t/CORE/io/print.t
1..21
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11ok 12
ok 13
ok 14
ok 15
ok 16ok 19
ok 20
ok 21

Original comment by reini.urban on 8 May 2014 at 1:21

GoogleCodeExporter commented 9 years ago
Fixed one 5.6 part: $, and $\ are no SVs on 5.6 with
commit 7bfcc542ba1bcd5e5df03c93fa41b25f7fabafd8
Author: Reini Urban <rurban@cpanel.net>
Date:   Thu May 8 09:14:49 2014 -0500

    Fix special 5.6. associations for $, $\ as they are no SVs there

    Fixes one part of #306 on 5.6.

    There still exists a refcnt problem on 5.6 (invalid free) with t/issue256.t
    And the remaining #306 regressions with t/CORE/io/print.t, t/CORE/op/tiehandle.t
    and t/CORE/op/smartkve.t

Original comment by reini.urban on 8 May 2014 at 2:21

GoogleCodeExporter commented 9 years ago
And fixed the issue 318 part with commit 
f950d8a569dbd2a364ea0885a6ce938c09fcb278
Author: Reini Urban <rurban@cpanel.net>
Date:   Thu May 8 09:54:57 2014 -0500

    Support local $\ = "somestring" (#318)

    Fixes coretest regressions from 1.43: t/CORE/io/print.t, t/CORE/op/tiehandle.t
    and t/CORE/op/smartkve.t,
    and fixes #318.

    PL_ors_sv needs to be initialized to PL_rs with proper SV -> GV backlink
    as perl initializes it as Nullsv.

But we now we've got a lot more failing io core tests

Original comment by reini.urban on 8 May 2014 at 2:59

GoogleCodeExporter commented 9 years ago
tracking new t/CORE/io failures in new ticket. this problem is fixed

Original comment by reini.urban on 8 May 2014 at 3:02