This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: Fix EBCDIC issue
authorKarl Williamson <khw@cpan.org>
Fri, 19 Aug 2016 03:13:04 +0000 (21:13 -0600)
committerKarl Williamson <khw@cpan.org>
Tue, 18 Oct 2016 02:29:25 +0000 (20:29 -0600)
The value here is Unicode, not native, so needs a different macro.
There's no test for this, as this is allocating space, and could be one
byte off, which is only a problem if it is one byte small, and we were
at a limit where that single byte made the difference.

toke.c

diff --git a/toke.c b/toke.c
index b6b4d08..c721575 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -3531,7 +3531,7 @@ S_scan_const(pTHX_ char *start)
                            sv_utf8_upgrade_flags_grow(
                                     sv,
                                     SV_GMAGIC|SV_FORCE_UTF8_UPGRADE,
-                                   UVCHR_SKIP(uv) + (STRLEN)(send - e) + 1);
+                                   OFFUNISKIP(uv) + (STRLEN)(send - e) + 1);
                            d = SvPVX(sv) + SvCUR(sv);
                            has_utf8 = TRUE;
                        }