From: Karl Williamson Date: Wed, 25 Apr 2018 18:49:19 +0000 (-0600) Subject: Unicode::UCD: Avoid uninit message X-Git-Tag: v5.29.0~44 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/32ea73a1fb86701a30aeea7df91aa2d38d6344c9 Unicode::UCD: Avoid uninit message I found a case where this array can be empty, so add a test for that to avoid trying to look at the first (non-existent) element. --- diff --git a/charclass_invlists.h b/charclass_invlists.h index ab565cc..99bfa0a 100644 --- a/charclass_invlists.h +++ b/charclass_invlists.h @@ -374237,7 +374237,7 @@ static const U8 WB_table[24][24] = { #endif /* defined(PERL_IN_REGEXEC_C) */ /* Generated from: - * 4d64b650346ff9ddbcd3986f0da13f3be2379d64c574a120ca7f534d8d17934c lib/Unicode/UCD.pm + * f0b404b165a72b0aaeca3ce517cd14ea1b501720c98719dadbb990f1952fc568 lib/Unicode/UCD.pm * ff4404ec64f308bdf7714c50f9fdf0d1d0bf3c34db4d0a67e58ef0c6f88e818f lib/unicore/ArabicShaping.txt * 292171a0a1c13d7e581e8781eb4cdf248243b1ab267354a63c7a14429dea2740 lib/unicore/BidiBrackets.txt * 8f2695cc42989a79a715ab0d2892bd0c998759180cfdfb998674447f48231940 lib/unicore/BidiMirroring.txt diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm index 6733e11..0bb9667 100644 --- a/lib/Unicode/UCD.pm +++ b/lib/Unicode/UCD.pm @@ -5,7 +5,7 @@ use warnings; no warnings 'surrogate'; # surrogates can be inputs to this use charnames (); -our $VERSION = '0.70'; +our $VERSION = '0.71'; require Exporter; @@ -3635,15 +3635,18 @@ RETRY: unshift @invlist, 0; } } - foreach my $i (0 .. @invlist - 1) { - $invmap[$i] = ($i % 2 == 0) ? 'Y' : 'N' - } - # The map includes lines for all code points; add one for the range - # from 0 to the first Y. - if ($invlist[0] != 0) { - unshift @invlist, 0; - unshift @invmap, 'N'; + if (@invlist) { + foreach my $i (0 .. @invlist - 1) { + $invmap[$i] = ($i % 2 == 0) ? 'Y' : 'N' + } + + # The map includes lines for all code points; add one for the range + # from 0 to the first Y. + if ($invlist[0] != 0) { + unshift @invlist, 0; + unshift @invmap, 'N'; + } } } else { diff --git a/regcharclass.h b/regcharclass.h index 1587f7d..9e8a6ad 100644 --- a/regcharclass.h +++ b/regcharclass.h @@ -1854,7 +1854,7 @@ #endif /* PERL_REGCHARCLASS_H_ */ /* Generated from: - * 4d64b650346ff9ddbcd3986f0da13f3be2379d64c574a120ca7f534d8d17934c lib/Unicode/UCD.pm + * f0b404b165a72b0aaeca3ce517cd14ea1b501720c98719dadbb990f1952fc568 lib/Unicode/UCD.pm * ff4404ec64f308bdf7714c50f9fdf0d1d0bf3c34db4d0a67e58ef0c6f88e818f lib/unicore/ArabicShaping.txt * 292171a0a1c13d7e581e8781eb4cdf248243b1ab267354a63c7a14429dea2740 lib/unicore/BidiBrackets.txt * 8f2695cc42989a79a715ab0d2892bd0c998759180cfdfb998674447f48231940 lib/unicore/BidiMirroring.txt diff --git a/uni_keywords.h b/uni_keywords.h index d7f21eb..4c56042 100644 --- a/uni_keywords.h +++ b/uni_keywords.h @@ -6710,7 +6710,7 @@ MPH_VALt match_uniprop( const unsigned char * const key, const U16 key_len ) { } /* Generated from: - * 4d64b650346ff9ddbcd3986f0da13f3be2379d64c574a120ca7f534d8d17934c lib/Unicode/UCD.pm + * f0b404b165a72b0aaeca3ce517cd14ea1b501720c98719dadbb990f1952fc568 lib/Unicode/UCD.pm * ff4404ec64f308bdf7714c50f9fdf0d1d0bf3c34db4d0a67e58ef0c6f88e818f lib/unicore/ArabicShaping.txt * 292171a0a1c13d7e581e8781eb4cdf248243b1ab267354a63c7a14429dea2740 lib/unicore/BidiBrackets.txt * 8f2695cc42989a79a715ab0d2892bd0c998759180cfdfb998674447f48231940 lib/unicore/BidiMirroring.txt