diff options
author | Arne Döring <arne.doering@gmx.net> | 2019-03-21 06:52:30 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-03-21 06:52:30 +0100 |
commit | 514674cb38e46b93d26f78e87244e1cfef67ccdb (patch) | |
tree | e5bd7164c3efce7f0a8d6086b5fe0188e8fe55ad /lib | |
parent | 28a926cb679100414a71bb8aefe349c5bdf69b26 (diff) | |
download | Nim-514674cb38e46b93d26f78e87244e1cfef67ccdb.tar.gz |
use abort instead of quit (#10872)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system/embedded.nim | 3 | ||||
-rw-r--r-- | lib/system/excpt.nim | 11 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/system/embedded.nim b/lib/system/embedded.nim index fb89e7f0f..d1e05dad5 100644 --- a/lib/system/embedded.nim +++ b/lib/system/embedded.nim @@ -29,8 +29,7 @@ const nativeStackTraceSupported = false hasSomeStackTrace = false -proc quitOrDebug() {.inline.} = - quit(1) +proc quitOrDebug() {.noreturn, importc: "abort", header: "<stdlib.h>", nodecl.} proc raiseException(e: ref Exception, ename: cstring) {.compilerRtl.} = sysFatal(ReraiseError, "exception handling is not available") diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 8849caee5..75a0e8967 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -38,10 +38,15 @@ proc showErrorMessage(data: cstring) {.gcsafe.} = writeToStdErr(data) proc quitOrDebug() {.inline.} = - when not defined(endb): - quit(1) - else: + when defined(endb): endbStep() # call the debugger + elif not defined(nodejs) and not defined(nimscript): + when nimvm: + quit(1) + else: + c_abort() + else: + quit(1) proc chckIndx(i, a, b: int): int {.inline, compilerproc, benign.} proc chckRange(i, a, b: int): int {.inline, compilerproc, benign.} |