Allow a stab line number of 0, since G++ generates it; check for >= 2**20.
authorMichael Meissner <meissner@gcc.gnu.org>
Thu, 22 Oct 1992 18:57:59 +0000 (18:57 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Thu, 22 Oct 1992 18:57:59 +0000 (18:57 +0000)
From-SVN: r2561

gcc/mips-tfile.c

index 94ecc55..78f8236 100644 (file)
@@ -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],