summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/cpperror.c2
-rw-r--r--gcc/cppexp.c3
-rw-r--r--gcc/cpphash.c14
-rw-r--r--gcc/cpplib.c5
-rw-r--r--gcc/cppmain.c18
6 files changed, 25 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 21b0b5cf69f..30745256021 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+1999-04-14 12:37 -0400 Zack Weinberg <zack@rabi.columbia.edu>
+
+ * cpperror.c, cppexp.c, cpplib.c: Never call abort.
+ * cpphash.c: Only call abort when we detect corruption of the
+ malloc arena.
+ * cppmain.c: Don't define fatal or fancy_abort.
+
Wed Apr 14 09:19:39 1999 Jan Hubicka <hubicka@freesoft.cz>
* i386.c (x86_adjust_cost): Agi stall takes 1 cycle on Pentium, fst
@@ -36,7 +43,7 @@ Wed Apr 14 00:08:46 1999 Richard Henderson <rth@cygnus.com>
* i386.h (memory_address_length): Declare it.
Tue Apr 13 22:52:04 1999 Donn Terry (donn@interix.com)
- Martin Heller (Ing.-Buero_Heller@t-online.de)
+ Martin Heller (Ing.-Buero_Heller@t-online.de)
* configure.in (interix Alpha): Add.
(winnt Alpha): Use alpha32.h
@@ -55,7 +62,7 @@ Tue Apr 13 22:52:04 1999 Donn Terry (donn@interix.com)
* config/alpha/xm-alpha-interix.h: New file.
- * config/alpha/t-interix: New file.
+ * config/alpha/t-interix: New file.
* fixinc/mkfixinc.sh (interix/Alpha): Add.
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index af018815d93..c7339dcb808 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -114,7 +114,7 @@ v_cpp_message (pfile, is_error, msgid, ap)
pfile->errors = CPP_FATAL_LIMIT;
break;
default:
- abort ();
+ cpp_fatal (pfile, "internal error: bad is_error(%d) in v_cpp_message", is_error);
}
vfprintf (stderr, _(msgid), ap);
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index 24e7c2313d9..aef6d195dc6 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -721,7 +721,8 @@ cpp_parse_expr (pfile)
switch (op.op)
{
case NAME:
- abort ();
+ cpp_fatal (pfile, "internal error: cpp_lex returns a NAME");
+ goto syntax_error;
case INT: case CHAR:
top->value = op.value;
top->unsignedp = op.unsignedp;
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 06de9d443ef..6e601a0fd5e 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -26,6 +26,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "system.h"
#include "cpplib.h"
#include "cpphash.h"
+#undef abort
static int comp_def_part PARAMS ((int, U_CHAR *, int, U_CHAR *,
int, int));
@@ -290,7 +291,10 @@ collect_expansion (pfile, buf, limit, nargs, arglist)
that something smarter should happen. */
if (limit < buf)
- abort ();
+ {
+ cpp_fatal (pfile, "internal error: limit < buf in collect_expansion");
+ limit = buf; /* treat it like a null defn */
+ }
/* Find the beginning of the trailing whitespace. */
p = buf;
@@ -1011,9 +1015,6 @@ special_symbol (hp, pfile)
cpp_fatal (pfile, "cpplib internal error: invalid special hash type");
return;
}
-
- /* This point should be unreachable. */
- abort ();
}
/* Expand a macro call.
@@ -1408,7 +1409,10 @@ macroexpand (pfile, hp)
}
if (totlen > xbuf_len)
- abort ();
+ {
+ cpp_fatal (pfile, "internal_error: buffer overrun in macroexpand");
+ return;
+ }
}
/* if there is anything left of the definition
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 3ed75db1d66..aa198dd931b 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -836,7 +836,10 @@ cpp_expand_to_buffer (pfile, buf, length)
#endif
if (length < 0)
- abort ();
+ {
+ cpp_fatal (pfile, "internal error: length < 0 in cpp_expand_to_buffer");
+ return;
+ }
/* Set up the input on the input stack. */
diff --git a/gcc/cppmain.c b/gcc/cppmain.c
index 5e3ed90f5b3..5142cad918f 100644
--- a/gcc/cppmain.c
+++ b/gcc/cppmain.c
@@ -37,24 +37,6 @@ char *progname;
cpp_reader parse_in;
cpp_options options;
-#ifdef abort
-/* More 'friendly' abort that prints the line and file.
- config.h can #define abort fancy_abort if you like that sort of thing. */
-void
-fatal (s)
- char *s;
-{
- fputs (s, stderr);
- exit (FATAL_EXIT_CODE);
-}
-
-void
-fancy_abort ()
-{
- fatal ("Internal gcc abort.");
-}
-#endif
-
int
main (argc, argv)