* alternative way to fix #16022 * add testcase for #16022 [backport:1.4]
This commit is contained in:
parent
109cc45398
commit
6cf5ca1dc2
2 changed files with 10 additions and 3 deletions
|
|
@ -327,10 +327,10 @@ proc setPointer*(x: Any, y: pointer) =
|
|||
## ``akString``, ``akCString``, ``akProc``, ``akRef``, ``akPtr``,
|
||||
## ``akPointer``, ``akSequence``.
|
||||
assert x.rawType.kind in pointerLike
|
||||
if y != nil:
|
||||
if y != nil and x.rawType.kind != tyPointer:
|
||||
genericAssign(x.value, y, x.rawType)
|
||||
else:
|
||||
cast[ppointer](x.value)[] = nil
|
||||
cast[ppointer](x.value)[] = y
|
||||
|
||||
proc fieldsAux(p: pointer, n: ptr TNimNode,
|
||||
ret: var seq[tuple[name: cstring, any: Any]]) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue