summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-03-21 09:34:02 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-03-21 09:34:02 +0100
commit83c105c3a33caf5e3158afdc540413e3795c159c (patch)
treeeb3139405db326a5b596f39e6497059a82e01d41 /lib/system
parent49c786331a4f7ef409437bd3c08202b5a5d73bed (diff)
parent48d5e4f95cc36f3f2dba1f21b66efad1882d5d27 (diff)
downloadNim-83c105c3a33caf5e3158afdc540413e3795c159c.tar.gz
Merge branch 'devel' of github.com:nim-lang/Nim into devel
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/embedded.nim3
-rw-r--r--lib/system/excpt.nim11
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.}