Closed planetis-m closed 2 years ago
Case object transitions are actually the culprit for the second. The only way to fix this is:
var kindTmp = tmpSym.kindSym
mFunc(kindTmp)
when defined(gcDestructors):
{.cast(uncheckedAssign).}:
tmpSym.kindSym = kindTmp
else:
tmpSym = (typeof tmpSym)(kindSym: kindTmp)
The test run but the default gc may report misaligned address errors, i.e:
Nim/lib/system/gc_common.nim:394:33: runtime error: load of misaligned address 0x7ffd3bd64404 for type 'void *', which requires 8 byte alignment
It's also incorrect (previous fields are ignored). -d:nimOldCaseObjects
caused even more errors. The only thing that works is --mm:arc/orc.
Documented in the readme.
I also getting this error with Nim 1.6.6: /nim-drchaos/drchaos/common.nim(88, 32) Error: expression has no address; maybe use 'unsafeAddr'
Thanks for reporting this is fixed in v0.1.4
Both are caused by nil pointers. For the first one I made a bug report in https://github.com/nim-lang/Nim/issues/20278