comments for recent gcsafe pragmas

This commit is contained in:
Ștefan Talpalaru 2021-11-19 01:07:46 +01:00
parent cc22234dc6
commit 56e007d165
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9

View File

@ -284,6 +284,7 @@ proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
procBody, nnkIteratorDef)
closureIterator.pragma = newNimNode(nnkPragma, lineInfoFrom=prc.body)
closureIterator.addPragma(newIdentNode("closure"))
# https://github.com/nim-lang/RFCs/issues/435
closureIterator.addPragma(newIdentNode("gcsafe"))
# TODO when push raises is active in a module, the iterator here inherits
@ -331,6 +332,7 @@ proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
if prc.kind != nnkLambda: # TODO: Nim bug?
prc.addPragma(newColonExpr(ident "stackTrace", ident "off"))
# https://github.com/nim-lang/RFCs/issues/435
prc.addPragma(newIdentNode("gcsafe"))
result = prc