[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Fri Feb 26 15:04:01 UTC 2016


The branch master has been updated
       via  d9706f1964ffbfcfe700cfeb59605465b309013a (commit)
      from  0f2d3e4e4e88e92998329aab0fd912d89dc4a836 (commit)


- Log -----------------------------------------------------------------
commit d9706f1964ffbfcfe700cfeb59605465b309013a
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Feb 26 14:10:17 2016 +0000

    Fix a mkdef.pl warning
    
    mkdef.pl was issuing the following error:
    
     Use of uninitialized value within %tag in numeric eq (==) at
     util/mkdef.pl line 560, <IN> line 92
    
    This was because it was treating a __cplusplus "#ifdef" check as a "tag"
    but then skipping over the corresponding "#endif". Therefore after
    processing a file it still had "left over" tags from processing the
    previous file. It was also getting confused by "#if" checks that didn't
    match is pre-defined styles.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 util/mkdef.pl | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/util/mkdef.pl b/util/mkdef.pl
index a79ddf5..a7abfd2 100755
--- a/util/mkdef.pl
+++ b/util/mkdef.pl
@@ -494,7 +494,10 @@ sub do_defs
 				$cpp-- if /^#\s*endif/;
 				next;
 			}
-			$cpp = 1 if /^#.*ifdef.*cplusplus/;
+			if (/^#.*ifdef.*cplusplus/) {
+				$cpp = 1;
+				next;
+			}
 
 			s/{[^{}]*}//gs;                      # ignore {} blocks
 			print STDERR "DEBUG: \$def=\"$def\"\n" if $debug && $def ne "";
@@ -581,6 +584,7 @@ sub do_defs
 				pop(@tag);
 			} elsif (/^\#\s*else/) {
 				my $tag_i = $#tag;
+				die "$file unmatched else\n" if $tag_i < 0;
 				while($tag[$tag_i] ne "-") {
 					my $t=$tag[$tag_i];
 					$tag{$t}= -$tag{$t};
@@ -599,6 +603,9 @@ sub do_defs
 				push(@tag,"TRUE");
 				$tag{"TRUE"}=-1;
 				print STDERR "DEBUG: $file: found 0\n" if $debug;
+			} elsif (/^\#\s*if\s+/) {
+				#Some other unrecognized "if" style
+				push(@tag,"-");
 			} elsif (/^\#\s*define\s+(\w+)\s+(\w+)/
 				 && $symhacking && $tag{'TRUE'} != -1) {
 				# This is for aliasing.  When we find an alias,
@@ -875,6 +882,7 @@ sub do_defs
 			}
 		}
 		close(IN);
+		die "$file: Unmatched tags\n" if $#tag >= 0;
 
 		my $algs;
 		my $plays;


More information about the openssl-commits mailing list