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

`nim check` (and nim c --errorMax:0) SIGSEGV on first `index out of bounds` error #10104

Closed
timotheecour opened this issue Dec 27, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@timotheecour
Copy link
Contributor

commented Dec 27, 2018

Example

type Foo = object
  a1: int

block:
  discard Foo().a2

block:
  static:
    let a = [1,2]
    echo a[5] # BUG: nim check gives: SIGSEGV: Illegal storage access. (Attempt to read from nil?)

discard Foo().a4

Current Output

nim c --errorMax:10 $timn_D/bugs/all/t0087.nim

t0087.nim(5, 6) template/generic instantiation from here
t0087.nim(9, 16) Error: undeclared field: 'a2'
    discard Foo().a2
                 ^
t0087.nim(5, 6) template/generic instantiation from here
t0087.nim(9, 16) Error: undeclared field: '.'
    discard Foo().a2
                 ^
t0087.nim(5, 6) template/generic instantiation from here
t0087.nim(9, 16) Error: expression '.' cannot be called
    discard Foo().a2
                 ^
stack trace: (most recent call last)
t0087.nim(14)            t0087
t0087.nim(5, 6) template/generic instantiation from here
t0087.nim(14, 11) Error: index out of bounds
      echo a[5] # BUG: nim check gives: SIGSEGV: Illegal storage access. (Attempt to read from nil?)
            ^
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

nim check $timn_D/bugs/all/t0087.nim

t0087.nim(5, 6) template/generic instantiation from here
t0087.nim(9, 16) Error: undeclared field: 'a2'
    discard Foo().a2
                 ^
t0087.nim(5, 6) template/generic instantiation from here
t0087.nim(9, 16) Error: undeclared field: '.'
    discard Foo().a2
                 ^
t0087.nim(5, 6) template/generic instantiation from here
t0087.nim(9, 16) Error: expression '.' cannot be called
    discard Foo().a2
                 ^
stack trace: (most recent call last)
t0087.nim(14)            t0087
t0087.nim(5, 6) template/generic instantiation from here
t0087.nim(14, 11) Error: index out of bounds
      echo a[5] # BUG: nim check gives: SIGSEGV: Illegal storage access. (Attempt to read from nil?)
            ^
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

Expected Output

no SIGSEGV, and keeps reporting subsequent errors after the Error: index out of bounds error

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.