diff options
author | Karl Williamson <khw@cpan.org> | 2021-06-30 11:15:56 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2021-08-07 04:46:45 -0600 |
commit | 1dff551d79b00d841b88282abc2e1fa43adaff5b (patch) | |
tree | 0bcc358125a1f2088efbe8da9614d4525f07856c /regen | |
parent | bc5a92d8a7e80ce9c119eea0195a6626c5138615 (diff) | |
download | perl-1dff551d79b00d841b88282abc2e1fa43adaff5b.tar.gz |
regcharclass.pl: Add an error check
Diffstat (limited to 'regen')
-rwxr-xr-x | regen/regcharclass.pl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/regen/regcharclass.pl b/regen/regcharclass.pl index 39de579127..9fc939fdef 100755 --- a/regen/regcharclass.pl +++ b/regen/regcharclass.pl @@ -1114,7 +1114,11 @@ sub _cond_as_str { # If the first range matches all 256 possible bytes, it is # trivially true. - return 1 if $ranges[0]->[1] == 0xFF; + if ($ranges[0]->[1] == 0xFF) { + die "Range spanning all bytes must be the only one" + if @ranges > 1; + return 1; + } # this case # Here, the first range starts at 0, but doesn't match everything. # But the condition doesn't have to worry about being < 0 |