In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/cbf40e71df30fba4761230a8b62a34d7bb247495?hp=00c7fba717c4212ca81ed1a46acf38ed3685c27c>
- Log ----------------------------------------------------------------- commit cbf40e71df30fba4761230a8b62a34d7bb247495 Author: David Mitchell <[email protected]> Date: Mon Jan 30 12:25:55 2017 +0000 signature sub (\x80 triggered an assertion RT #130661 In the presence of 'use feature "signatures"', a char >= 0x80 where a sigil was expected triggered an assert failure, because the (signed) character was being was being promoted to int and ended up getting returned from yylex() as a negative value. ----------------------------------------------------------------------- Summary of changes: t/op/signatures.t | 6 ++++++ toke.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/t/op/signatures.t b/t/op/signatures.t index 0e53bf05d2..aa785bf65c 100644 --- a/t/op/signatures.t +++ b/t/op/signatures.t @@ -1463,6 +1463,12 @@ is scalar(t145()), undef; "masking warning"; } +# RT #130661 a char >= 0x80 in a signature when a sigil was expected +# was triggering an assertion + +eval "sub (\x80"; +like $@, qr/A signature parameter must start with/, "RT #130661"; + use File::Spec::Functions; diff --git a/toke.c b/toke.c index 10ee5007c6..7dcdd5afa1 100644 --- a/toke.c +++ b/toke.c @@ -5037,7 +5037,7 @@ Perl_yylex(pTHX) * as a var; e.g. ($, ...) would be seen as the var '$,' */ - char sigil; + U8 sigil; s = skipspace(s); sigil = *s++; -- Perl5 Master Repository
