This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PATCH: [perl #133992] Assertion failure in scan_const
I haven't done the digging, but this appears to be a failure to include
UTF-8 processing when 'use utf8' was added to Perl.
The code that was causing this in toke.c had found a qr/(?#... beginning
of comment in a pattern. It attempted to space up to but not including
the final character, which is handled later. (In most instances that
final character is a single-byte ')', but not in this test case. It
spaced per-byte. The problem is that if the final character is in UTF-8
and isn't a single byte, it leaves the input position pointing at the
final byte of that character, which creates malformed UTF-8, which the
assertion discovered.
The fix is to be cognizant that this is UTF-8 when spacing to the end,
so that the final position begins at the first byte of it.