aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2004-10-07 00:21:38 +0000
committerKen Raeburn <raeburn@mit.edu>2004-10-07 00:21:38 +0000
commit8500f37be5f958cc59e38bb2ad3369820670db1a (patch)
tree2c4205d6a1b4535bd33478071f423387cbb51774
parentf4e8ab562c89578aec48e21349b7d80eccc87387 (diff)
downloadkrb5-8500f37be5f958cc59e38bb2ad3369820670db1a.zip
krb5-8500f37be5f958cc59e38bb2ad3369820670db1a.tar.gz
krb5-8500f37be5f958cc59e38bb2ad3369820670db1a.tar.bz2
* et_c.awk, et_h.awk: Complain if the error table is too large.
* et_c.pl, et_h.pl: Regenerated. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16811 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/util/et/ChangeLog5
-rw-r--r--src/util/et/et_c.awk4
-rw-r--r--src/util/et/et_c.pl15
-rw-r--r--src/util/et/et_h.awk4
-rw-r--r--src/util/et/et_h.pl27
5 files changed, 41 insertions, 14 deletions
diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog
index e3c2d7a..0c71148 100644
--- a/src/util/et/ChangeLog
+++ b/src/util/et/ChangeLog
@@ -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 &&
diff --git a/src/util/et/et_c.awk b/src/util/et/et_c.awk
index fc2e1ac..3368842 100644
--- a/src/util/et/et_c.awk
+++ b/src/util/et/et_c.awk
@@ -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
diff --git a/src/util/et/et_c.pl b/src/util/et/et_c.pl
index f635bc1..a4348a4 100644
--- a/src/util/et/et_c.pl
+++ b/src/util/et/et_c.pl
@@ -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;
diff --git a/src/util/et/et_h.awk b/src/util/et/et_h.awk
index 7a81dfa..3800838 100644
--- a/src/util/et/et_h.awk
+++ b/src/util/et/et_h.awk
@@ -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) \
diff --git a/src/util/et/et_h.pl b/src/util/et/et_h.pl
index 1105550..b5d1ee9 100644
--- a/src/util/et/et_h.pl
+++ b/src/util/et/et_h.pl
@@ -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,15 +190,13 @@ 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) &&
@@ -201,6 +204,16 @@ else {
'_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_' .
$table_name . '_error_table');
@@ -209,12 +222,10 @@ else {
$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;