OpenSSL::Ordinals: when validating, collect statistics on unassigned syms
authorRichard Levitte <levitte@openssl.org>
Mon, 4 Nov 2019 09:31:04 +0000 (10:31 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 5 Nov 2019 21:44:21 +0000 (22:44 +0100)
If a script wants to display how many symbols have assigned numbers
and how many don't, this gives them those numbers.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10348)

util/perl/OpenSSL/Ordinals.pm

index 411cdc9..c3cfc98 100644 (file)
@@ -662,6 +662,11 @@ sub validate {
                     && @{$self->{contents}->[$i] // []})) {
             $self->{stats}->{new}++;
         }
+        if ($i <= $self->{maxassigned}) {
+            $self->{stats}->{assigned}++;
+        } else {
+            $self->{stats}->{unassigned}++;
+        }
         next if ($i > $self->{loaded_maxnum});
 
         my @loaded_strings =