|
From: Nicholas N. <nj...@ca...> - 2004-11-08 13:31:43
|
CVS commit by nethercote:
Don't silently ignore any suppression contexts beyond the 4th -- instead abort
with a warning. Addresses part of bug #77922.
MERGED FROM HEAD
M +16 -5 vg_errcontext.c 1.58.2.2
--- valgrind/coregrind/vg_errcontext.c #1.58.2.1:1.58.2.2
@@ -787,5 +787,5 @@ static void load_one_suppressions_file (
# define N_BUF 200
Int fd, i;
- Bool eof;
+ Bool eof, too_many_contexts = False;
Char buf[N_BUF+1];
Char* tool_names;
@@ -883,7 +883,11 @@ static void load_one_suppressions_file (
VG_N_SUPP_CALLERS */
if (!VG_STREQ(buf, "}")) {
- do {
- eof = VG_(get_line) ( fd, buf, N_BUF );
- } while (!eof && !VG_STREQ(buf, "}"));
+ // Don't just ignore extra lines -- abort. (Someone complained
+ // about silent ignoring of lines in bug #77922.)
+ //do {
+ // eof = VG_(get_line) ( fd, buf, N_BUF );
+ //} while (!eof && !VG_STREQ(buf, "}"));
+ too_many_contexts = True;
+ goto syntax_error;
}
@@ -899,4 +903,11 @@ static void load_one_suppressions_file (
"FATAL: in suppressions file `%s': unexpected EOF",
filename );
+ } else if (too_many_contexts) {
+ VG_(message)(Vg_UserMsg,
+ "FATAL: in suppressions file: `%s': at %s:",
+ filename, buf );
+ VG_(message)(Vg_UserMsg,
+ "too many lines (limit of %d contexts in suppressions)",
+ VG_N_SUPP_CALLERS);
} else {
VG_(message)(Vg_UserMsg,
|