diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2019-04-18 20:15:15 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2019-04-18 20:15:15 +0300 |
commit | 9abeda33e7ce111a266d5e3ec4dafe65c26d5cd0 (patch) | |
tree | 68694f00d403866a7d64c606b93db56155aaf56f /main.c | |
parent | 33218616b4987c7afd860d0b3f4dad9cdb703547 (diff) | |
download | egawk-9abeda33e7ce111a266d5e3ec4dafe65c26d5cd0.tar.gz egawk-9abeda33e7ce111a266d5e3ec4dafe65c26d5cd0.tar.bz2 egawk-9abeda33e7ce111a266d5e3ec4dafe65c26d5cd0.zip |
Fix core dump upon syntax error.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |