In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/534636494a1e2160ed87b0b7531ddb162be85b6e?hp=c64356a259d7e7fe57a4e90f9501c9d861be4ce1>
- Log ----------------------------------------------------------------- commit 534636494a1e2160ed87b0b7531ddb162be85b6e Author: Karl Williamson <[email protected]> Date: Thu Mar 7 13:44:34 2019 -0700 PATCH: [perl #133882] Assertion failure The asserts in this routine were doing there job. It was called inappropriately, with len set to 0, which means for it that it's supposed to calculate the length by using strlen(). But, len being 0 here meant that the input was empty. When run under valgrind, errors would also show up. This function was being called to see if the string had any characters that varied depending on if it is UTF-8 or not. Since we know that the answer is no if the length is 0, we simply don't call this function then. commit 1c766bfb7607df442a390e97691c2be8a14cd109 Author: Karl Williamson <[email protected]> Date: Thu Mar 7 13:44:14 2019 -0700 t/re/subst.t: Fix typo in comment ----------------------------------------------------------------------- Summary of changes: t/re/subst.t | 8 ++++++-- toke.c | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/t/re/subst.t b/t/re/subst.t index 32076921f5..2ce08049e0 100644 --- a/t/re/subst.t +++ b/t/re/subst.t @@ -11,7 +11,7 @@ BEGIN { require './loc_tools.pl'; } -plan(tests => 277); +plan(tests => 278); $_ = 'david'; $a = s/david/rules/r; @@ -1174,8 +1174,12 @@ __EOF__ is $lines, 4, "RT #131930"; } -{ # [perl $133899], would panic +{ # [perl #133899], would panic fresh_perl_is('my $a = "ha"; $a =~ s!|0?h\x{300}(?{})!!gi', "", {}, "[perl #133899] s!|0?h\\x{300}(?{})!!gi panics"); } + +{ + fresh_perl_is("s//00000000000format \0 '0000000\\x{800}/;eval", "", {}, "RT #133882"); +} diff --git a/toke.c b/toke.c index 0bf86ad314..c46b9e8fda 100644 --- a/toke.c +++ b/toke.c @@ -2068,6 +2068,7 @@ S_newSV_maybe_utf8(pTHX_ const char *const start, STRLEN len) SV * const sv = newSVpvn_utf8(start, len, ! IN_BYTES && UTF + && len != 0 && is_utf8_non_invariant_string((const U8*)start, len)); return sv; } -- Perl5 Master Repository
