From b865c41d292b2088fbb482c4b1001015c227feb0 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Thu, 22 Oct 1992 18:57:59 +0000 Subject: Allow a stab line number of 0, since G++ generates it; check for >= 2**20. From-SVN: r2561 --- gcc/mips-tfile.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/mips-tfile.c') diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c index 94ecc55..78f8236 100644 --- a/gcc/mips-tfile.c +++ b/gcc/mips-tfile.c @@ -3678,12 +3678,18 @@ parse_stabs_common (string_start, string_end, rest) code = strtol (p+3, &p, 0); ch = *++p; - if (code <= 0 || p[-1] != ',' || isdigit (ch) || !IS_ASM_IDENT (ch)) + if (p[-1] != ',' || isdigit (ch) || !IS_ASM_IDENT (ch)) { error ("Illegal line number .stabs/.stabn directive"); return; } + if (code < 0 || code >= 0x100000) + { + error ("Line number for .stabs/.stabn directive cannot fit in index field (20 bits)"); + return; + } + shash_ptr = hash_string (p, strlen (p) - 1, &orig_str_hash[0], -- cgit v1.1