You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code works on refc, but doesn't work on ARC. As I presume the problem is that for some reason Nim doesn't detect that mCreator is captured by the add and it destroys the closure. Found in https://github.com/ftsf/nimsynth when trying to compile it with ARC :)
hello
Traceback (most recent call last)
/home/dian/Stuff/arctest/a.nim(5) a
/home/dian/Things/Nim/lib/system/refs_v2.nim(177) nimDestroyAndDispose
/home/dian/Things/Nim/lib/system/refs_v2.nim(162) nimRawDispose
/home/dian/Things/Nim/lib/system/alloc.nim(972) dealloc
/home/dian/Things/Nim/lib/system/alloc.nim(871) rawDealloc
/home/dian/Things/Nim/lib/system/avltree.nim(74) del
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Expected Output
hello
$ nim -v
Nim Compiler Version 1.3.5 [Linux: amd64]
Compiled at 2020-07-21
Copyright (c) 2006-2020 by Andreas Rumpf
git hash: 911e39351e34c1022b586fe9bfc3a67b2ce3bf44
active boot switches: -d:release -d:danger
The text was updated successfully, but these errors were encountered:
ghost
changed the title
[ARC] Closure captured in a seq gets destroyed in the end of the scope
[ARC] SIGSEGV when calling a closure as a tuple field in a seq
Jul 22, 2020
This code works on refc, but doesn't work on ARC. As I presume the problem is that for some reason Nim doesn't detect that mCreator is captured by the
add
and it destroys the closure. Found in https://github.com/ftsf/nimsynth when trying to compile it with ARC :)Example
Current Output
Expected Output
The text was updated successfully, but these errors were encountered: