develooper Front page | perl.perl5.porters | Postings from February 2003

Re: [FIX] [perl #8760]

Thread Previous | Thread Next
From:
Enache Adrian
Date:
February 4, 2003 09:27
Subject:
Re: [FIX] [perl #8760]
Message ID:
20030204173501.GB935@ratsnest.hole
On Tue, Feb 04, 2003 at 11:25:41AM +0100, Rafael Garcia-Suarez wrote:
> Enache Adrian <enache@rdslink.ro> wrote:
> > On Mon, Feb 03, 2003 at 05:52:17PM +0200, Jarkko Hietaniemi wrote:
> > > 
> > >   $_ = "foo";
> > >   utf8::upgrade($_);
> > >   warn (/bar/i ? "bar" : "no bar");
> > > 
> > >  and I also spent some time in the debugger and it seems that
> > >  Perl_pp_warn -> Perl_warner -> Perl_vmess -> S_closest_cop
> > >  thinks that CopLINE is zero, and that's why the line and the file
> > >  are not printed.  I have no idea why CopLINE would be zero because
> > >  of case-insensitively matching against a UTF-8-ed scalar (Yes, the /i
> > >  is required.)
> > 
> > This fixes it for me:
> 
> Thanks, for the patch, but I've already fixed it in a less intrusive
> way (I restore only the cop_line for the current cop.) And I patched
> in function Perl_vload_module.
> See : http://archive.develooper.com/perl5-changes%40perl.org/msg06629.html
> (strangely, the message I sent to P5P hasn't shown up already).

I didn't know about your patch. I only read the P5P list.
 
> However I have the impression that your patch is more correct than
> mine, without any evidence (I don't restore curcop but only cop_line,
> and it appears that I get the correct cop_file(gv)? with and without
> threads.) If you can work out any proof that your patch avoids problems
> that my patch doesn't address, I'll be happy to apply it. I'll look
> at it more closely in the meantime.

cop_file(gv) is correct because Perl_scalarseq() sets PL_curcop to
PL_compiling, which of course has the correct ->cop_file field.
This isn't true of the other fields.

You may consider saving/restoring the PL_curcop pointer instead of
the cop_file field , but I don't think that's mission-critical :)

Regards
Adi

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