use abort instead of quit (#10872)
This commit is contained in:
parent
28a926cb67
commit
514674cb38
2 changed files with 9 additions and 5 deletions
|
|
@ -29,8 +29,7 @@ const
|
||||||
nativeStackTraceSupported = false
|
nativeStackTraceSupported = false
|
||||||
hasSomeStackTrace = false
|
hasSomeStackTrace = false
|
||||||
|
|
||||||
proc quitOrDebug() {.inline.} =
|
proc quitOrDebug() {.noreturn, importc: "abort", header: "<stdlib.h>", nodecl.}
|
||||||
quit(1)
|
|
||||||
|
|
||||||
proc raiseException(e: ref Exception, ename: cstring) {.compilerRtl.} =
|
proc raiseException(e: ref Exception, ename: cstring) {.compilerRtl.} =
|
||||||
sysFatal(ReraiseError, "exception handling is not available")
|
sysFatal(ReraiseError, "exception handling is not available")
|
||||||
|
|
|
||||||
|
|
@ -38,10 +38,15 @@ proc showErrorMessage(data: cstring) {.gcsafe.} =
|
||||||
writeToStdErr(data)
|
writeToStdErr(data)
|
||||||
|
|
||||||
proc quitOrDebug() {.inline.} =
|
proc quitOrDebug() {.inline.} =
|
||||||
when not defined(endb):
|
when defined(endb):
|
||||||
quit(1)
|
|
||||||
else:
|
|
||||||
endbStep() # call the debugger
|
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 chckIndx(i, a, b: int): int {.inline, compilerproc, benign.}
|
||||||
proc chckRange(i, a, b: int): int {.inline, compilerproc, benign.}
|
proc chckRange(i, a, b: int): int {.inline, compilerproc, benign.}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue