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 411cdc9d60c47c93eddec59547010c0aa741a1fe..c3cfc98e71b0a6e65af6b214567b41da25db5265 100644 (file)
@@ -662,6 +662,11 @@ sub validate {
                     && @{$self->{contents}->[$i] // []})) {
             $self->{stats}->{new}++;
         }
                     && @{$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 =
         next if ($i > $self->{loaded_maxnum});
 
         my @loaded_strings =