]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Accept blank lines in <binutils>/opcodes/s390-opc.txt.
authorFlorian Krohm <florian@eich-krohm.de>
Thu, 6 Dec 2012 05:03:08 +0000 (05:03 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Thu, 6 Dec 2012 05:03:08 +0000 (05:03 +0000)
Bug fix: avoid reading something uninitialised

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13157

auxprogs/s390-check-opcodes.pl

index d38747690e6d4473df1667a951d0d87983716163..3a16d6c84165b3c374a8d3e5854f9e8f18109537 100755 (executable)
@@ -35,6 +35,7 @@ open(OPC, "$opc_file") || die "cannot open $opc_file\n";
 while (my $line = <OPC>) {
     chomp $line;
     next if ($line =~ "^[ ]*#");   # comments
+    next if ($line =~ /^\s*$/);    # blank line
     my $description = (split /"/,$line)[1];
     my ($encoding,$mnemonic,$format) = split /\s+/,$line;
 
@@ -144,8 +145,12 @@ foreach my $opc (keys %csv_desc) {
 # 2) Make sure opcode descriptions are the same
 #----------------------------------------------------
 foreach my $opc (keys %opc_desc) {
-    if ($opc_desc{$opc} ne $csv_desc{$opc}) {
-        print "*** opcode $opc differs: $opc_desc{$opc}\n";
+    if (defined $csv_desc{$opc}) {
+        if ($opc_desc{$opc} ne $csv_desc{$opc}) {
+            print "*** opcode $opc differs:\n";
+        print "    binutils:    $opc_desc{$opc}\n";
+            print "    opcodes.csv: $csv_desc{$opc}\n";
+        }
     }
 }