develooper Front page | perl.perl5.porters | Postings from July 2016

Re: substr as parameter to a XS sub

Thread Previous | Thread Next
July 4, 2016 08:33
Re: substr as parameter to a XS sub
Message ID:

>> Is this a bug, or something I am doing incorrectly?
>> I imagine this happens becuse substr can be used as an lvalue, but I am not
>> 100% sure.
> The SvPV_nolen() in the standard typemap for T_PV should handle that
> correctly.
> A non-default typemap that changes the mapping for char * or changes
> T_PV could break it.
> If you have a more complete example please open a ticket.


You just found the problem, I think. This is the typemap:

	$var = (SvOK ($arg)) ? ($type) SvPV ($arg,PL_na) : NULL

and this is the comment from the original author:

# this is needed so we can pass 'undef' for the filename to
# Text::BibTeX::Entry::parse and have it wind up as NULL
# in bt_parse_entry()

Can you help me working a new typemap?


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