summary refs log tree commit diff stats
path: root/compiler/injectdestructors.nim
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2020-07-17 10:56:17 +0200
committerGitHub <noreply@github.com>2020-07-17 10:56:17 +0200
commit1355b461aa70cd1e17b2f07085aa6c97cb54283f (patch)
tree493f236f32668e5379a1c6dfa61a846ffbaa90d2 /compiler/injectdestructors.nim
parent9fb7467fda597957634b17782745a7f25d83296f (diff)
downloadNim-1355b461aa70cd1e17b2f07085aa6c97cb54283f.tar.gz
Show that a variable is cursor in --expandArc (#15002)
Diffstat (limited to 'compiler/injectdestructors.nim')
-rw-r--r--compiler/injectdestructors.nim11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/injectdestructors.nim b/compiler/injectdestructors.nim
index 556d098f4..99eefca57 100644
--- a/compiler/injectdestructors.nim
+++ b/compiler/injectdestructors.nim
@@ -35,7 +35,6 @@ type
   Con = object
     owner: PSym
     g: ControlFlowGraph
-    cursors: IntSet
     graph: ModuleGraph
     otherRead: PNode
     inLoop, inSpawn: int
@@ -152,13 +151,13 @@ proc isLastRead(location: PNode; cfg: ControlFlowGraph; otherRead: var PNode; pc
 proc isCursor(n: PNode; c: Con): bool =
   case n.kind
   of nkSym:
-    result = sfCursor in n.sym.flags or c.cursors.contains(n.sym.id)
+    sfCursor in n.sym.flags
   of nkDotExpr:
-    result = sfCursor in n[1].sym.flags
+    isCursor(n[1], c)
   of nkCheckedFieldExpr:
-    result = isCursor(n[0], c)
+    isCursor(n[0], c)
   else:
-    result = false
+    false
 
 proc isLastRead(n: PNode; c: var Con): bool =
   # first we need to search for the instruction that belongs to 'n':
@@ -1043,7 +1042,7 @@ proc injectDestructorCalls*(g: ModuleGraph; owner: PSym; n: PNode): PNode =
     echoCfg(c.g)
     echo n
 
-  c.cursors = computeCursors(n, g.config)
+  computeCursors(n, g.config)
 
   var scope: Scope
   let body = p(n, c, scope, normal)