develooper Front page | perl.perl5.porters | Postings from March 2008

[PATCH] Double magic with substr

Thread Next
Vincent Pit
March 31, 2008 10:06
[PATCH] Double magic with substr
Message ID:
substr currently calls get magic twice on the substr'd string :
- the first one fires with SvPV_const(sv, curlen) in pp_substr ;
- the second one occurs with SvPV_force(bigstr, curlen) at sv_insert.
Rafael and Nicholas agreed that we should implement a sv_insert_flags, 
and here's the thing.
The new sv_insert_flags is the same as the old sv_insert, except that 
SvPV_force was replaced by SvPV_force_flags, to which the flags are 
directly passed down. I also updated the corresponding call in 
pp_substr. From what I've tested with Variable::Magic, this seemed to 
fix the double magic in all cases.
I kept a symbol to the old Perl_sv_insert so that modules built against 
it can still link, but I don't know if this has to be expected or if 
there's a better way to achieve it.
Regen ran, tested ok against 33612.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About