Front page | perl.perl5.porters |
Postings from December 2004
Re: excessive swash init?
Thread Previous
|
Thread Next
From:
Nicholas Clark
Date:
December 30, 2004 14:19
Subject:
Re: excessive swash init?
Message ID:
20041230221919.GK77507@plum.flirble.org
On Thu, Dec 30, 2004 at 08:57:30PM +0000, Nicholas Clark wrote:
> While investigating bug 33185 I had a watchpoint on PL_bostr, and I saw
> something that surprised me. It seems that the data lines from
> lib/unicore/lib/gc_sc/Print.pl were getting processed multiple times.
>
> It seems that S_reginclass calls Perl_regclass_swash like this:
>
> SV *sw = regclass_swash(n, TRUE, 0, (SV**)&av);
>
> where that TRUE is for doinit, and in turn Perl_regclass_swatch is repeatedly
> calling swash_init here:
>
> if (a)
> sw = *a;
> else if (si && doinit) {
> sw = swash_init("utf8", "", si, 1, 0);
> (void)av_store(av, 1, sw);
> }
>
>
> Is there excessive repeated initialisation going on? Or is all as it should
> be?
Panic less - it seems that this only happens under the perl debugger.
But when running with perl -d I am repeatedly hitting this:
Breakpoint 1, Perl_regclass_swash (my_perl=0x800200, node=0x0, doinit=1 '\001', listsvp=0x0, altsvp=0xbfffee34) at regexec.c:4337
4337 sw = swash_init("utf8", "", si, 1, 0);
It looks like this logic is incorrect:
si = *ary;
a = SvTYPE(ary[1]) == SVt_RV ? &ary[1] : 0;
b = SvTYPE(ary[2]) == SVt_PVAV ? &ary[2] : 0;
because:
(gdb) call Perl_sv_dump(my_perl, ary[1])
SV = PVMG(0x949600) at 0x334334
REFCNT = 1
FLAGS = (ROK)
IV = 0
NV = 0
RV = 0x3341b4
PV = 0x3341b4 ""
CUR = 0
LEN = 0
Would it be reasonable to replace that SvTYPE check with an SvROK check?
Nicholas Clark
Thread Previous
|
Thread Next