summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-10-19 21:03:20 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-10-19 21:03:20 +0200
commit1a0032eb6875c58ec1b64e9d98240e43cef04b91 (patch)
tree5db6b46c647c75f69cfd5dd5da23981d04bf7586 /compiler
parent8be60dc6bd5885f2eda43d11077d2743dd0ee742 (diff)
downloadNim-1a0032eb6875c58ec1b64e9d98240e43cef04b91.tar.gz
added broken tbintree test
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semasgn.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/semasgn.nim b/compiler/semasgn.nim
index 857c9a1e0..895946281 100644
--- a/compiler/semasgn.nim
+++ b/compiler/semasgn.nim
@@ -287,16 +287,15 @@ proc liftBody(c: PContext; typ: PType; kind: TTypeAttachedOp;
   if kind != attachedDestructor:
     result.typ.addParam src
 
-  # recursion is handled explicitly, but register the type based operation
-  # here in order to keep things robust against runaway recursions:
+  liftBodyAux(a, typ, body, newSymNode(dest).newDeref, newSymNode(src))
+  # recursion is handled explicitly, do not register the type based operation
+  # before 'liftBodyAux':
   case kind
   of attachedAsgn: typ.assignment = result
   of attachedSink: typ.sink = result
   of attachedDeepCopy: typ.deepCopy = result
   of attachedDestructor: typ.destructor = result
 
-  liftBodyAux(a, typ, body, newSymNode(dest).newDeref, newSymNode(src))
-
   var n = newNodeI(nkProcDef, info, bodyPos+1)
   for i in 0 .. < n.len: n.sons[i] = emptyNode
   n.sons[namePos] = newSymNode(result)