compiler sigsegv while processing varargs #4475

Closed
cheatfate opened this Issue Jul 11, 2016 · 0 comments

Projects

None yet

1 participant

@cheatfate
Contributor

This code compilation

import strtabs
var t = newStringTable(mode = modeCaseInsensitive)

causes this:

Hint: used config file 'I:\Nim\config\nim.cfg' [Conf]
Hint: system [Processing]
Hint: testtabs [Processing]
Hint: strtabs [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: math [Processing]
Hint: algorithm [Processing]
Hint: times [Processing]
Hint: winlean [Processing]
Hint: dynlib [Processing]
Hint: hashes [Processing]
Hint: etcpriv [Processing]
Traceback (most recent call last)
nim.nim(115)             nim
nim.nim(71)              handleCmdLine
main.nim(253)            mainCommand
main.nim(64)             commandCompileToC
modules.nim(227)         compileProject
modules.nim(172)         compileModule
passes.nim(203)          processModule
passes.nim(137)          processTopLevelStmt
sem.nim(489)             myProcess
sem.nim(461)             semStmtAndGenerateGenerics
semstmts.nim(1536)       semStmt
semexprs.nim(872)        semExprNoType
semexprs.nim(2386)       semExpr
semstmts.nim(432)        semVarOrLet
semexprs.nim(42)         semExprWithType
semexprs.nim(2305)       semExpr
semexprs.nim(856)        semDirectOp
semexprs.nim(842)        afterCallActions
sigmatch.nim(1726)       semFinishOperands
sigmatch.nim(1541)       prepareOperand
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
@kierdavis kierdavis added a commit to kierdavis/Nim that referenced this issue Jul 11, 2016
@kierdavis kierdavis Add regression test for fix for #4475 023f1da
@Araq Araq pushed a commit that closed this issue Jul 11, 2016
@kierdavis kierdavis Fix #4475
Existing implementation would append the default value for a varargs parameter (the empty array) to the end of the sons of the
nnkCall node, rather than storing it into the correct index. This left the location where it should have been stored set to
its default value of nil, causing later code that uses this node to segfault.
56015e5
@Araq Araq closed this in 56015e5 Jul 11, 2016
@oderwat oderwat added a commit to oderwat/Nim that referenced this issue Jul 24, 2016
@oderwat oderwat Revert "Fix #4475"
This reverts commit 56015e5.
926c3a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment