This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Unicode::UCD: Avoid uninit message
authorKarl Williamson <khw@cpan.org>
Wed, 25 Apr 2018 18:49:19 +0000 (12:49 -0600)
committerKarl Williamson <khw@cpan.org>
Mon, 25 Jun 2018 13:33:27 +0000 (07:33 -0600)
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.

charclass_invlists.h
lib/Unicode/UCD.pm
regcharclass.h
uni_keywords.h

index ab565cc..99bfa0a 100644 (file)
@@ -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
index 6733e11..0bb9667 100644 (file)
@@ -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 {
index 1587f7d..9e8a6ad 100644 (file)
 #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
index d7f21eb..4c56042 100644 (file)
@@ -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