VM: support importc var, ptr/pointer types, cast int <=> ptr/pointer (#12877)
* VM: allow certain hardcoded special var variables at CT * VM: allow all importc var, cast[int](ptr) * fix tests tests/vm/tstaticprintseq.nim, tests/cpp/t8241.nim * VM: == works for ptr/pointer nodes * bugfix: ==, cast now also works for pointer, not just ptr * VM supports cast PtrLikeKinds <=> PtrLikeKinds / int * improve cname handling * fixup + bug fix * VM: support cast from ref to int * address comment: opcLdGlobalDeref => opcLdGlobalDerefFFI * defensive check against typ == nil
This commit is contained in:
parent
a1beeb313f
commit
13c08f3ab4
7 changed files with 199 additions and 35 deletions
|
|
@ -700,7 +700,7 @@ proc loadDynamicLib(m: BModule, lib: PLib) =
|
|||
|
||||
proc mangleDynLibProc(sym: PSym): Rope =
|
||||
# we have to build this as a single rope in order not to trip the
|
||||
# optimization in genInfixCall
|
||||
# optimization in genInfixCall, see test tests/cpp/t8241.nim
|
||||
if sfCompilerProc in sym.flags:
|
||||
# NOTE: sym.loc.r is the external name!
|
||||
result = rope(sym.name.s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue