From cc22234dc6f8963e17c8bb158dd18b7feefc364b Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 19 Nov 2021 01:05:47 +0100 Subject: [PATCH] Prepare chronos for Nim version 1.6 (#226) --- chronos/asyncmacro2.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chronos/asyncmacro2.nim b/chronos/asyncmacro2.nim index ddc843a..bc4ef28 100644 --- a/chronos/asyncmacro2.nim +++ b/chronos/asyncmacro2.nim @@ -284,6 +284,7 @@ proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} = procBody, nnkIteratorDef) closureIterator.pragma = newNimNode(nnkPragma, lineInfoFrom=prc.body) closureIterator.addPragma(newIdentNode("closure")) + closureIterator.addPragma(newIdentNode("gcsafe")) # TODO when push raises is active in a module, the iterator here inherits # that annotation - here we explicitly disable it again which goes @@ -330,6 +331,7 @@ proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} = if prc.kind != nnkLambda: # TODO: Nim bug? prc.addPragma(newColonExpr(ident "stackTrace", ident "off")) + prc.addPragma(newIdentNode("gcsafe")) result = prc if subtypeIsVoid: