]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
* et_c.awk, et_h.awk: Complain if the error table is too large.
authorKen Raeburn <raeburn@mit.edu>
Thu, 7 Oct 2004 00:21:38 +0000 (00:21 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 7 Oct 2004 00:21:38 +0000 (00:21 +0000)
* et_c.pl, et_h.pl: Regenerated.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16811 dc483132-0cff-0310-8789-dd5450dbe970

src/util/et/ChangeLog
src/util/et/et_c.awk
src/util/et/et_c.pl
src/util/et/et_h.awk
src/util/et/et_h.pl

index e3c2d7a205ffde01ead34ed4f8024d26eff7a8f2..0c7114832373f2ad22a7e6ad235838d3a6799a9a 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-06  Ken Raeburn  <raeburn@mit.edu>
+
+       * et_c.awk, et_h.awk: Complain if the error table is too large.
+       * et_c.pl, et_h.pl: Regenerated.
+
 2004-07-03  Ken Raeburn  <raeburn@mit.edu>
 
        * error_message.c (remove_error_table) [!ENABLE_THREADS &&
index fc2e1ac53aa59298cf377a8ebe84bbe164ce02ae..3368842351fca011b9d8350b867ea1873bee308a 100644 (file)
@@ -184,6 +184,10 @@ c2n["_"]=63
        skipone=0
 }
 END {
+       if (table_item_count > 255) {
+           print "Error table too large!" | "cat 1>&2"
+           exit 1
+       }
        print "    0" > outfile
        print "};" > outfile
        print "" > outfile
index f635bc1ac044cfcd5d7473dc8c6bbbaa94b9d1dc..a4348a40991aa2c3ab515488a07d705e34d20583 100644 (file)
@@ -144,9 +144,7 @@ line: while (<>) {
        &Pick('>', $outfile) &&
            (print $fh '');
        &Pick('>', $outfile) &&
-           (print $fh
-
-             '#if !defined(_WIN32)');
+           (print $fh '#if !defined(_WIN32)');
        &Pick('>', $outfile) &&
            (print $fh 'extern void initialize_' . $table_name .
 
@@ -232,6 +230,11 @@ line: while (<>) {
     $skipone = 0;
 }
 
+if ($table_item_count > 255) {
+    &Pick('|', 'cat 1>&2') &&
+       (print $fh 'Error table too large!');
+    exit 1;
+}
 &Pick('>', $outfile) &&
     (print $fh '    0');
 &Pick('>', $outfile) &&
@@ -261,9 +264,7 @@ else {
 &Pick('>', $outfile) &&
     (print $fh '');
 &Pick('>', $outfile) &&
-    (print $fh
-
-      '#if !defined(_WIN32)');
+    (print $fh '#if !defined(_WIN32)');
 &Pick('>', $outfile) &&
     (print $fh 'void initialize_' . $table_name . '_error_table (void)');
 &Pick('>', $outfile) &&
@@ -279,6 +280,8 @@ else {
 &Pick('>', $outfile) &&
     (print $fh '#endif');
 
+exit $ExitValue;
+
 sub Pick {
     local($mode,$name,$pipe) = @_;
     $fh = $name;
index 7a81dfa3f8afbb681636eb9bc3141f9d65468278..38008383030d1b381dc15c1cd409ac0a4c01c62c 100644 (file)
@@ -136,6 +136,10 @@ c2n["_"]=63
 }
 
 END {
+       if (table_item_count > 255) {
+           print "Error table too large!" | "cat 1>&2"
+           exit 1
+       }
        if (tab_base_high == 0) {
                print "#define ERROR_TABLE_BASE_" table_name " (" \
                        sprintf("%d", tab_base_sign*tab_base_low) \
index 1105550989ebf740270022c3e94b7165c231b39a..b5d1ee9801095e7de119da305844ec4a7f265239 100644 (file)
@@ -168,6 +168,11 @@ line: while (<>) {
     }
 }
 
+if ($table_item_count > 255) {
+    &Pick('|', 'cat 1>&2') &&
+       (print $fh 'Error table too large!');
+    exit 1;
+}
 if ($tab_base_high == 0) {
     &Pick('>', $outfile) &&
        (print $fh '#define ERROR_TABLE_BASE_' . $table_name . ' (' .
@@ -185,21 +190,29 @@ else {
 &Pick('>', $outfile) &&
     (print $fh '');
 &Pick('>', $outfile) &&
-    (print $fh 'extern struct error_table et_' . $table_name .
+    (print $fh 'extern const struct error_table et_' . $table_name .
 
       '_error_table;');
 &Pick('>', $outfile) &&
     (print $fh '');
 &Pick('>', $outfile) &&
-    (print $fh
-
-      '#if !defined(_WIN32)');
+    (print $fh '#if !defined(_WIN32)');
 &Pick('>', $outfile) &&
     (print $fh '/* for compatibility with older versions... */');
 &Pick('>', $outfile) &&
     (print $fh 'extern void initialize_' . $table_name .
 
       '_error_table () /*@modifies internalState@*/;');
+&Pick('>', $outfile) &&
+    (print $fh '#else');
+&Pick('>', $outfile) &&
+    (print $fh '#define initialize_' . $table_name . '_error_table()');
+&Pick('>', $outfile) &&
+    (print $fh '#endif');
+&Pick('>', $outfile) &&
+    (print $fh '');
+&Pick('>', $outfile) &&
+    (print $fh '#if !defined(_WIN32)');
 &Pick('>', $outfile) &&
     (print $fh '#define init_' . $table_name . '_err_tbl initialize_' .
 
@@ -208,13 +221,11 @@ else {
     (print $fh '#define ' . $table_name . '_err_base ERROR_TABLE_BASE_' .
 
       $table_name);
-&Pick('>', $outfile) &&
-    (print $fh '#else');
-&Pick('>', $outfile) &&
-    (print $fh '#define initialize_' . $table_name . '_error_table()');
 &Pick('>', $outfile) &&
     (print $fh '#endif');
 
+exit $ExitValue;
+
 sub Pick {
     local($mode,$name,$pipe) = @_;
     $fh = $name;