This failed to adequately handle empty properties; something that wasn't
seen until compiling older Unicode releases.
* 668579029ac0720853bf19781ec10ec922495271543c91531d7a6db3fcdffba9 lib/unicore/mktables
* 462c9aaa608fb2014cd9649af1c5c009485c60b9c8b15b89401fdc10cf6161c6 lib/unicore/version
* c6884f4d629f04d1316f3476cb1050b6a1b98ca30c903262955d4eae337c6b1e regen/charset_translations.pl
* 668579029ac0720853bf19781ec10ec922495271543c91531d7a6db3fcdffba9 lib/unicore/mktables
* 462c9aaa608fb2014cd9649af1c5c009485c60b9c8b15b89401fdc10cf6161c6 lib/unicore/version
* c6884f4d629f04d1316f3476cb1050b6a1b98ca30c903262955d4eae337c6b1e regen/charset_translations.pl
- * f199f92c0b5f87882b0198936ea8ef3dc43627b57a77ac3eb9250bd2664bbd88 regen/mk_invlists.pl
+ * 3ea229d7bcbcb5864f985bcdcb6007f51949870d54f1dc469f299778051a9c94 regen/mk_invlists.pl
my $charset = shift // ""; # name of character set for comment
die "No inversion list for $name" unless defined $invlist
my $charset = shift // ""; # name of character set for comment
die "No inversion list for $name" unless defined $invlist
- && ref $invlist eq 'ARRAY'
- && @$invlist;
+ && ref $invlist eq 'ARRAY';
# Output the inversion list $invlist using the name $name for it.
# It is output in the exact internal form for inversion lists.
# Is the last element of the header 0, or 1 ?
my $zero_or_one = 0;
# Output the inversion list $invlist using the name $name for it.
# It is output in the exact internal form for inversion lists.
# Is the last element of the header 0, or 1 ?
my $zero_or_one = 0;
- if ($invlist->[0] != 0) {
+ if (@$invlist && $invlist->[0] != 0) {
unshift @$invlist, 0;
$zero_or_one = 1;
}
unshift @$invlist, 0;
$zero_or_one = 1;
}
else {
@invlist = prop_invlist($lookup_prop, '_perl_core_internal_ok');
if (! @invlist) {
else {
@invlist = prop_invlist($lookup_prop, '_perl_core_internal_ok');
if (! @invlist) {
- my ($list_ref, $map_ref, $format, $default);
- ($list_ref, $map_ref, $format, $default)
+ # If couldn't find a non-empty inversion list, see if it is
+ # instead an inversion map
+ my ($list_ref, $map_ref, $format, $default)
= prop_invmap($lookup_prop, '_perl_core_internal_ok');
= prop_invmap($lookup_prop, '_perl_core_internal_ok');
- die "Could not find inversion list for '$lookup_prop'" unless $list_ref;
+ if (! $list_ref) {
+ # An empty return here could mean an unknown property, or
+ # merely that the original inversion list is empty. Call
+ # in scalar context to differentiate
+ my $count = prop_invlist($lookup_prop,
+ '_perl_core_internal_ok');
+ die "Could not find inversion list for '$lookup_prop'"
+ unless defined $count;
+ }
+ else {
@invlist = @$list_ref;
@invmap = @$map_ref;
$map_format = $format;
$map_default = $default;
$maps_to_code_point = $map_format =~ /x/;
$to_adjust = $map_format =~ /a/;
@invlist = @$list_ref;
@invmap = @$map_ref;
$map_format = $format;
$map_default = $default;
$maps_to_code_point = $map_format =~ /x/;
$to_adjust = $map_format =~ /a/;
- die "Could not find inversion list for '$lookup_prop'" unless @invlist;
+
+
+ # Short-circuit an empty inversion list.
+ if (! @invlist) {
+ output_invlist($prop_name, \@invlist, $charset);
+ next;
+ }
# Re-order the Unicode code points to native ones for this platform.
# This is only needed for code points below 256, because native code
# Re-order the Unicode code points to native ones for this platform.
# This is only needed for code points below 256, because native code