Open timotheecour opened 4 years ago
can compilerapi be used to have user defined vmops? eg: see $nim_devel_D/tests/compilerapi/tcompilerapi.nim
intr.implementRoutine("*", "exposed", "addFloats", proc (a: VmArgs) =
setResult(a, getFloat(a, 0) + getFloat(a, 1) + getFloat(a, 2))
)
# var buffer2 = cast[cstring](cast[int](c_malloc(n)))
Error: VM does not support 'cast' from tyInt to tyCString
when defined case1: # D20200507T202125:here gitissue
#[
Error: opcCastIntToPtr: regs[rb].kind: rkRegisterAddr result = hash(cast[ptr Hash](addr(y))[])
]#
import hashes
proc main =
var a = 123.4
echo hash(a)
static: main()
pure/cstrutils.nim(58, 14) Error: index 3 not in 0 .. 2 if suffix[i] == '\0': return true
when defined case2: #D20200507T213758:here gitissue
import std/cstrutils
template fun()=
echo endsWith("foobar".cstring, "bar".cstring)
static: fun()
execute
regs[ra].intVal = cast[int](regs[rb].node.intVal)
eg: /Users/timothee/git_clone/nim/Nim_prs/lib/system/fatal.nim(49) sysFatal Error: unhandled exception: 'intVal' is not accessible using discriminant 'kind' of type 'TNode' [FieldError]
even when compiled w --stacktrace:on -d:debug eg: