Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

SIGSEGV when array is used as var return type #106

Closed
zah opened this Issue · 0 comments

1 participant

@zah
Owner
type
  TArrayType = array[0..5, int]

  TArrayHolder = object
    arr: TArrayType

proc ArrayAccessor(x: var TArrayHolder): var TArrayType =
  result = x.arr

proc MakeArrayHolder: TArrayHolder =
  for i in low(result.arr)..high(result.arr):
    result.arr[i] = i

var x = MakeArrayHolder()
x.ArrayAccessor[2] = 20 ## SIGSEGV here
@zah zah closed this issue from a commit
@zah zah fixes #106 cd9c504
@zah zah closed this in cd9c504
@reactormonk reactormonk referenced this issue from a commit in reactormonk/nim
@zah zah fixes #106 fd2fcc3
@Varriount Varriount referenced this issue from a commit
@zah zah fixes #106 2efdf3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.