This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Handle non-PV $_ in @INC filters
@INC filters (code refs returned by code refs in @INC) are given the
current line of code in $_ and can modify it. The C code that invokes
the Perl filter is in pp_ctl.c:S_run_user_filter. It was not taking
into account that $_ might not have a PV pointer when it is returned,
and so this could result in crashes or assertion failures.
This commit forces the scalar to be a string before returning it to
the lexer, unless it is undef. If we force it to be a string when it
is undef, then existing tests start producing uninitialized warnings.
The logic is still faulty in places. Subsequent commits will
address that.