aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.c b/main.c
index d6e34266..8327cc74 100644
--- a/main.c
+++ b/main.c
@@ -1262,6 +1262,9 @@ catchsig(int sig)
|| sig == SIGBUS
#endif
) {
+ if (errcount > 0) // assume a syntax error corrupted our data structures
+ exit(EXIT_FATAL);
+
set_loc(__FILE__, __LINE__);
msg(_("fatal error: internal error"));
/* fatal won't abort() if not compiled for debugging */
@@ -1279,6 +1282,9 @@ catchsig(int sig)
static int
catchsegv(void *fault_address, int serious)
{
+ if (errcount > 0) // assume a syntax error corrupted our data structures
+ exit(EXIT_FATAL);
+
set_loc(__FILE__, __LINE__);
msg(_("fatal error: internal error: segfault"));
fflush(NULL);