summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorYuriy Glukhov <yuriy.glukhov@gmail.com>2018-05-04 15:23:47 +0300
committerYuriy Glukhov <yuriy.glukhov@gmail.com>2018-05-09 22:25:28 +0300
commitce634909281ffc8efbc7d192f557ffe38f49e740 (patch)
tree6d8ce63c9009e299262586774ddabbaa875b4b89 /lib
parent0ed6c3e476e421827d081e9ab0d9fcb0d3de5eb2 (diff)
downloadNim-ce634909281ffc8efbc7d192f557ffe38f49e740.tar.gz
Yield in try
Diffstat (limited to 'lib')
-rw-r--r--lib/system/embedded.nim3
-rw-r--r--lib/system/excpt.nim4
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/system/embedded.nim b/lib/system/embedded.nim
index 46e84e056..4d453fcca 100644
--- a/lib/system/embedded.nim
+++ b/lib/system/embedded.nim
@@ -41,3 +41,6 @@ proc reraiseException() {.compilerRtl.} =
 proc writeStackTrace() = discard
 
 proc setControlCHook(hook: proc () {.noconv.}) = discard
+
+proc closureIterSetupExc(e: ref Exception) {.compilerproc, inline.} =
+  sysFatal(ReraiseError, "exception handling is not available")
diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim
index fb38948f7..dabfe010e 100644
--- a/lib/system/excpt.nim
+++ b/lib/system/excpt.nim
@@ -131,6 +131,10 @@ proc popCurrentExceptionEx(id: uint) {.compilerRtl.} =
       quitOrDebug()
     prev.up = cur.up
 
+proc closureIterSetupExc(e: ref Exception) {.compilerproc, inline.} =
+  if not e.isNil:
+    currException = e
+
 # some platforms have native support for stack traces:
 const
   nativeStackTraceSupported* = (defined(macosx) or defined(linux)) and