summaryrefslogtreecommitdiff
path: root/regen/regcharclass.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-06-22 10:46:39 -0600
committerKarl Williamson <khw@cpan.org>2015-07-28 22:15:53 -0600
commitc03e41ddc9c98a44c7e3bbd365ef8e1d6e960c1a (patch)
tree6dc75ce6fb2a0bc3ad7b1150a2b0ea0a66cf0946 /regen/regcharclass.pl
parente82d2a1153721495728bf5c66dd913c878f8ca52 (diff)
downloadperl-c03e41ddc9c98a44c7e3bbd365ef8e1d6e960c1a.tar.gz
regen/regcharclass.pl: Handle empty lists
Short circuit the remaining code and return a 0 if the input doesn't match anything
Diffstat (limited to 'regen/regcharclass.pl')
-rwxr-xr-xregen/regcharclass.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/regen/regcharclass.pl b/regen/regcharclass.pl
index 184437e88f..489a6d679f 100755
--- a/regen/regcharclass.pl
+++ b/regen/regcharclass.pl
@@ -610,6 +610,8 @@ sub length_optree {
my $else= ( $opt{else} ||= 0 );
+ return $else if $self->{count} == 0;
+
my $method = $type =~ /generic/ ? 'generic_optree' : 'optree';
if ($method eq 'optree' && scalar keys %{$self->{size}{$type}} == 1) {