diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/collections/tables.nim | 2 | ||||
-rwxr-xr-x | lib/system/assign.nim | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index f817ec800..d1ed7586a 100644 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -16,7 +16,7 @@ ## ``shallowADT`` to compile a version that uses shallow copies instead. import - os, hashes, math + hashes, math when defined(shallowADT): {.pragma: myShallow, shallow.} diff --git a/lib/system/assign.nim b/lib/system/assign.nim index c71525a12..798409ba5 100755 --- a/lib/system/assign.nim +++ b/lib/system/assign.nim @@ -13,10 +13,9 @@ proc genericAssignAux(dest, src: Pointer, n: ptr TNimNode, shallow: bool) = d = cast[TAddress](dest) s = cast[TAddress](src) case n.kind - of nkNone: assert(false) of nkSlot: - genericAssignAux(cast[pointer](d +% n.offset), cast[pointer](s +% n.offset), - n.typ, shallow) + genericAssignAux(cast[pointer](d +% n.offset), + cast[pointer](s +% n.offset), n.typ, shallow) of nkList: for i in 0..n.len-1: genericAssignAux(dest, src, n.sons[i], shallow) @@ -25,6 +24,10 @@ proc genericAssignAux(dest, src: Pointer, n: ptr TNimNode, shallow: bool) = n.typ.size) var m = selectBranch(src, n) if m != nil: genericAssignAux(dest, src, m, shallow) + else: + echo "ugh memory corruption! ", n.kind + quit 1 + #of nkNone: assert(false) proc genericAssignAux(dest, src: Pointer, mt: PNimType, shallow: bool) = var |