mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-29 03:37:55 +00:00
fixes explicit globals in macros (#21502)
(cherry picked from commit b2c1dcbbc9)
This commit is contained in:
@@ -1932,7 +1932,8 @@ proc genVarSection(c: PCtx; n: PNode) =
|
||||
c.genAdditionalCopy(a[2], opcWrDeref, tmp, 0, val)
|
||||
c.freeTemp(val)
|
||||
c.freeTemp(tmp)
|
||||
elif not importcCondVar(s) and not (s.typ.kind == tyProc and s.typ.callConv == ccClosure): # fixes #10938
|
||||
elif not importcCondVar(s) and not (s.typ.kind == tyProc and s.typ.callConv == ccClosure) and
|
||||
sfPure notin s.flags: # fixes #10938
|
||||
# there is a pre-existing issue with closure types in VM
|
||||
# if `(var s: proc () = default(proc ()); doAssert s == nil)` works for you;
|
||||
# you might remove the second condition.
|
||||
|
||||
Reference in New Issue
Block a user