diff options
Diffstat (limited to 'lib/system/excpt.nim')
-rw-r--r-- | lib/system/excpt.nim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index be41a63a7..bae5de9d3 100644 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -45,6 +45,17 @@ var # a global variable for the root of all try blocks currException {.threadvar.}: ref Exception +type + FrameState = tuple[framePtr: PFrame, excHandler: PSafePoint, currException: ref Exception] + +proc getFrameState*(): FrameState {.compilerRtl, inl.} = + return (framePtr, excHandler, currException) + +proc setFrameState*(state: FrameState) {.compilerRtl, inl.} = + framePtr = state.framePtr + excHandler = state.excHandler + currException = state.currException + proc getFrame*(): PFrame {.compilerRtl, inl.} = framePtr proc popFrame {.compilerRtl, inl.} = |