Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allocCStringArray to a constant fails with nontelling Error #7903

Closed
Clyybber opened this issue May 29, 2018 · 2 comments
Closed

allocCStringArray to a constant fails with nontelling Error #7903

Clyybber opened this issue May 29, 2018 · 2 comments

Comments

@Clyybber
Copy link
Contributor

Clyybber commented May 29, 2018

On latest devel
const deviceExtensions = allocCStringArray(["somestring"])
fails with
lib/system.nim(3178, 16) Error: VM is only allowed to 'cast' between integers of same size

@Clyybber
Copy link
Contributor Author

Clyybber commented Jun 30, 2018

Stack trace with koch:

  const deviceExtensions = allocCStringArray(["somestring"])
  ^
lib/system.nim(3206, 16) Error: VM is only allowed to 'cast' between integers of same size
        result = cast[cstringArray](alloc0((a.len+1) * sizeof(cstring)))
                 ^
Traceback (most recent call last)
nim.nim(133) nim
nim.nim(97) handleCmdLine
main.nim(162) mainCommand
main.nim(73) commandCompileToC
modules.nim(124) compileProject
modules.nim(71) compileModule
passes.nim(194) processModule
passes.nim(103) processTopLevelStmt
sem.nim(592) myProcess
sem.nim(560) semStmtAndGenerateGenerics
semstmts.nim(1894) semStmt
semexprs.nim(908) semExprNoType
semexprs.nim(2536) semExpr
semstmts.nim(598) semConst
sem.nim(350) semConstExpr
vm.nim(1819) evalConstExpr
vm.nim(1815) evalConstExprAux
vm.nim(988) rawExecute vm.nim(394)
compile vmgen.nim(2055) genProc
vmgen.nim(258) gen
vmgen.nim(1865) gen
vmgen.nim(258) gen
vmgen.nim(1838) gen
vmgen.nim(1424) genAsgn
vmgen.nim(253) gen
vmgen.nim(1914) gen
vmgen.nim(805) genIntCast
msgs.nim(507) globalError
msgs.nim(495) liMessage
msgs.nim(329) handleError
msgs.nim(314) quit
FAILURE

@Clyybber
Copy link
Contributor Author

Now gives lib/system.nim(2189, 13) Error: VM does not support 'cast' from tyOpenArray to tyPtr which is good enough IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants