ARC: fixes cycle detection and move the .cursor attribute into closures (#12872)
This commit is contained in:
parent
e61d702206
commit
3524944e21
3 changed files with 57 additions and 1 deletions
|
|
@ -422,7 +422,8 @@ proc cycleCheck(n: PNode; c: var Con) =
|
|||
var field: PNode = nil
|
||||
while true:
|
||||
if x.kind == nkDotExpr:
|
||||
if field == nil: field = x[1]
|
||||
field = x[1]
|
||||
if field.kind == nkSym and sfCursor in field.sym.flags: return
|
||||
x = x[0]
|
||||
elif x.kind in {nkBracketExpr, nkCheckedFieldExpr, nkDerefExpr, nkHiddenDeref}:
|
||||
x = x[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue