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

macros.getTypeImpl regression, crash when trying to query type information from ref object #9600

Closed
jangko opened this issue Nov 2, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@jangko
Copy link
Contributor

commented Nov 2, 2018

Previously it works fine, then it crash horribly with recent devel branch.

import macros

type
  Apple = ref object of RootObj
  
macro mixer(x: typed): untyped =
  let w = getType(x)
  let v = getTypeImpl(w[1])

var z: Apple  
mixer(z)

error mesage:

Traceback (most recent call last)
nim.nim(108)             nim
nim.nim(72)              handleCmdLine
cmdlinehelper.nim(91)    loadConfigsAndRunMainCommand
main.nim(163)            mainCommand
main.nim(74)             commandCompileToC
modules.nim(126)         compileProject
modules.nim(71)          compileModule
passes.nim(194)          processModule
passes.nim(86)           processTopLevelStmt
sem.nim(600)             myProcess
sem.nim(568)             semStmtAndGenerateGenerics
semstmts.nim(1973)       semStmt
semexprs.nim(913)        semExprNoType
semexprs.nim(2534)       semExpr
semstmts.nim(1914)       semStmtList
semexprs.nim(2422)       semExpr
semexprs.nim(895)        semDirectOp
semexprs.nim(788)        afterCallActions
sem.nim(463)             semMacroExpr
vm.nim(1988)             evalMacroCall
vm.nim(1393)             rawExecute
vmdeps.nim(307)          opMapTypeImplToAst
vmdeps.nim(160)          mapTypeToAstX
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

jcosborn added a commit to jcosborn/Nim that referenced this issue Nov 2, 2018

@krux02 krux02 closed this in fc740c5 Nov 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.