diff options
author | kan <kan@FreeBSD.org> | 2003-11-07 02:43:04 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2003-11-07 02:43:04 +0000 |
commit | b09448931ae541a7a60fd1cf0ebac14b627fba69 (patch) | |
tree | 980c917e2cc50183c4d566d9a0f9a1c818e6a6cd /contrib/gcc/scan-decls.c | |
parent | dc227ec3ae9a56f16c472206f51e4838bb53a644 (diff) | |
download | FreeBSD-src-b09448931ae541a7a60fd1cf0ebac14b627fba69.zip FreeBSD-src-b09448931ae541a7a60fd1cf0ebac14b627fba69.tar.gz |
Gcc 3.3.3 20031106.
Diffstat (limited to 'contrib/gcc/scan-decls.c')
-rw-r--r-- | contrib/gcc/scan-decls.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/gcc/scan-decls.c b/contrib/gcc/scan-decls.c index e56401d..4f99319 100644 --- a/contrib/gcc/scan-decls.c +++ b/contrib/gcc/scan-decls.c @@ -32,7 +32,9 @@ int brace_nesting = 0; indicate the (brace nesting levels of) left braces that were prefixed by extern "C". */ int extern_C_braces_length = 0; -char extern_C_braces[20]; +/* 20 is not enough anymore on Solaris 9. */ +#define MAX_EXTERN_C_BRACES 200 +char extern_C_braces[MAX_EXTERN_C_BRACES]; #define in_extern_C_brace (extern_C_braces_length>0) /* True if the function declaration currently being scanned is @@ -222,6 +224,12 @@ scan_decls (pfile, argc, argv) brace_nesting++; extern_C_braces[extern_C_braces_length++] = brace_nesting; + if (extern_C_braces_length >= MAX_EXTERN_C_BRACES) + { + fprintf (stderr, + "Internal error: out-of-bounds index\n"); + exit (FATAL_EXIT_CODE); + } goto new_statement; } } |