Revert "follow #16009 VM supports cast nil to ptr (#16012)"

This reverts commit fec19c980e.
This commit is contained in:
Andrey R (cooldome) 2020-11-17 18:54:33 +00:00
commit 632af8afad
2 changed files with 0 additions and 33 deletions

View file

@ -901,9 +901,6 @@ proc genCastIntFloat(c: PCtx; n: PNode; dest: var TDest) =
c.gABx(n, opcSetType, dest, c.genType(dst))
c.gABC(n, opcCastIntToPtr, dest, tmp)
c.freeTemp(tmp)
elif src.kind == tyNil and dst.kind in PtrLikeKinds:
if dest < 0: dest = c.getTemp(n[0].typ)
genLit(c, n[1], dest)
else:
# todo: support cast from tyInt to tyRef
globalError(c.config, n.info, "VM does not support 'cast' from " & $src.kind & " to " & $dst.kind)