This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PATCH: [perl #119601] Bleadperl breaks ETHER/Devel-Declare
authorKarl Williamson <public@khwilliamson.com>
Fri, 6 Sep 2013 20:02:25 +0000 (14:02 -0600)
committerKarl Williamson <public@khwilliamson.com>
Fri, 6 Sep 2013 20:21:30 +0000 (14:21 -0600)
commit842991aefba7c153fb07a67b266f6e39af43fbab
treeb2fb6c7dee2856effe6365d3728ea27e8da32473
parent7b0e9f133bcaadc61e8b788c2453b0391aa28722
PATCH: [perl #119601] Bleadperl breaks ETHER/Devel-Declare

I will not otherwise mention that stealing .c code from the core is a
dangerous practice.

This is actually a bug in the module, which had been masked until now.
The first two parameters to utf8_to_uvchr_buf() are both U8*.  But  both
's' and PL_bufend are char*.  The 's' has a cast to U8* in the failing
line, but not PL_bufend.

Interestingly, the line in the official toke.c (introduced in 4b88fb76)
has always been right, so the stealer didn't copy it correctly.

What de69f3af3 did was turn this former function call into a macro that
manipulates the parameters and calls another function, thereby removing
a layer of function call overhead.  The manipulation involves
subtracting 's' from PL_bufend, and this fails to compile due to the
missing cast on the latter parameter.

The problem goes away if the macro casts both parameters to U8*, and
that is what this commit does.
utf8.h