aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>1999-04-14 09:40:56 +0000
committerZack Weinberg <zack@gcc.gnu.org>1999-04-14 09:40:56 +0000
commit34ca9541e706330f52d63cb1fde4adaf65c1775e (patch)
tree5c0f7e812107a4a1edffd2adab583d43d11252a1 /gcc/cpphash.c
parent42ebbb0a1d80d913a908b73aecf718e98f08cac4 (diff)
downloadgcc-34ca9541e706330f52d63cb1fde4adaf65c1775e.zip
gcc-34ca9541e706330f52d63cb1fde4adaf65c1775e.tar.gz
gcc-34ca9541e706330f52d63cb1fde4adaf65c1775e.tar.bz2
cpperror.c, [...]: Never call abort.
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. From-SVN: r26442
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 06de9d4..6e601a0 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