This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix spurious "uninitialized value" warning in regex match
The warning appeared if the pattern contains a floating substring for
which utf8 is needed, and the target string isn't in utf8. In this
situation, downgrading the floating substring yields undef, which
triggers the warning.
Matching can't succeed in this situation, because it's impossible for
the non-utf8 target string to contain any string which needs utf8 for
its own representation. So the warning is quelled by aborting the match
early.
Anchored substrings already have a check of this form; this commit makes
the corresponding change in the floating-substring case.