This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix regex failures on big-endian systems
authorKarl Williamson <khw@cpan.org>
Fri, 26 Feb 2016 20:57:10 +0000 (13:57 -0700)
committerKarl Williamson <khw@cpan.org>
Fri, 26 Feb 2016 21:27:51 +0000 (14:27 -0700)
commitb75fc44fb1c3317455f5b81899d9de706ffec56e
tree25efcfcb7a3d89cc134a3b3301881c351a7f8af0
parenta975eebad193acb8e3a92283cb3cdad1480b6ddc
Fix regex failures on big-endian systems

Commit accb4364d92e26c20e6a538fc04d1af52a8b94e2 caused regexes to fail
on big-endian systems.  It was because I used SvCUR where I should have
been using SvLEN, and was overwriting the final byte of real data with
0, which didn't matter as long as that byte was 0, which in our smokes
on litlle-endian systems, it was.

Further clarification is that inversion lists are stored as UV*, whereas
the scalar handling code is expecting char*.  By casting, it all works
out, except that the final byte is kept as a single char NUL.  I was
trying to write that final byte as a byte, but by using SvCUR, I was
getting a byte in one of the UVs.  With small numbers on a little-endian
system, that byte will be 0 anyway, but not on a big-endian one.
regcomp.c