nayakgi / perl-compiler

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

1.43_05: fix format STDOUT/STDERR broke 5.6.2 C #315

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

git bisect start master 1.40
git bisect run t/test-c-bisect.sh 1 5.6.2-nt

=> ee98e2245a489a241315056ffb3e01e7eb697ae6

$gv->FORM, Save_FORM for STD(OUT|ERR)

Original issue reported on code.google.com by reini.urban on 7 May 2014 at 1:39

GoogleCodeExporter commented 9 years ago
Fixed by disabling the code for GV code STDOUT.

    gv_list[5] = gv_fetchpv("STDOUT", GV_ADD, SVt_PV);
    SvFLAGS(gv_list[5]) = 0x600d;
    GvFLAGS(gv_list[5]) = 0x2; 
    GvLINE(gv_list[5]) = 0;
    if (SvPOK(gv_list[5]) && !SvPVX(gv_list[5])) SvPVX(gv_list[5]) = (char*)emptystring;
    SvREFCNT(gv_list[5]) = 13;
    GvREFCNT(gv_list[5]) += 1;
    GvFILE(gv_list[5]) = "ccode1.pl";
    SvSTASH_set((IO*)&sv_list[4], (HV*)hv0);
    SvREFCNT((SV*)hv0) += 1;
    GvIOp(gv_list[5]) = (IO*)&sv_list[4];

The 5.6 default is Nullgv for *stdout.

Original comment by reini.urban on 7 May 2014 at 2:01

GoogleCodeExporter commented 9 years ago
Fixed with commit bd490a99ae99d7004ce28f6824436830b64f709e
Author: Reini Urban <rurban@cpanel.net>
Date:   Wed May 7 09:03:31 2014 -0500

    C 5.6: fix STDOUT regression, issue #315

    The 5.6 default is Nullgv for *stdout, not a IO

    Remaining C fails:
      t/c_o3.t:  Failed tests:  17, 41
      t/c.t:     Failed test:  41

diff --git lib/B/C.pm lib/B/C.pm
index b01ef81..cddf2a0 100644
--- lib/B/C.pm
+++ lib/B/C.pm
@@ -3717,6 +3717,9 @@ sub B::GV::save {
   #  $init->add(qq[$sym = (GV*)&PL_sv_undef;]);
   #  return $sym;
   #}
+  if ($fullname =~ /^main::STDOUT$/i and $PERL56) {
+    return 'Nullgv'; # perl.c: setdefout(Nullgv)
+  }
   my $core_syms = {ENV    => 'PL_envgv',
                    ARGV   => 'PL_argvgv',
                    INC    => 'PL_incgv',

Original comment by reini.urban on 7 May 2014 at 2:13