Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
yglukhov committed Dec 7, 2023
1 parent c566e2f commit 5097e54
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions yasync.nim
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,9 @@ proc replaceDummyAwait(n, stateObj: NimNode, isCapture: bool): NimNode =
else:
# Call async.
res.add quote do:
proc getIterPtr(): ProcType {.nimcall, importc: `procPtrName`.}
getHeader(sub.`subId`).p = getIterPtr()
block:
proc getIterPtr(): ProcType {.nimcall, importc: `procPtrName`.}
getHeader(sub.`subId`).p = getIterPtr()

# Fill arguments
for i in 1 ..< n.len:
Expand Down Expand Up @@ -534,8 +535,9 @@ macro asyncLaunchWithEnv*(env: var AsyncEnv, call: typed{nkCall}): untyped =
fillArgs.add newCall(bindSym"fillArg", envAccess, newLit(i - 1), call[i])
result = quote do:
block:
proc getIterPtr(): ProcType {.nimcall, importc: `iterPtrName`.}
getHeader(`envAccess`).p = getIterPtr()
block:
proc getIterPtr(): ProcType {.nimcall, importc: `iterPtrName`.}
getHeader(`envAccess`).p = getIterPtr()
`fillArgs`
launch(cast[ptr ContBase](addr `envAccess`))

Expand Down

0 comments on commit 5097e54

Please sign in to comment.