You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following test case generates a null pointer dereference in the C code which results in SIGSEGV:
It should probably be catched by #124 or #7373, but I'm not sure how to slice part of
an array with compile-time known boundaries in a way compatible with JS and compile-time function evaluation.
typeFoo[N: static[int]] =object
data: array[N, int]
proclo[N: static[int]](x: Foo[N]): Foo[N div2] =for i in0..< N div2:
result.data[i] = x.data[i]
proclo[N: static[int]](x: varFoo[N]): varFoo[N div2] =for i in0..< N div2:
result.data[i] = x.data[i]
proc`lo=`[N: static[int]](x: varFoo[N], y: Foo[N div2]) =for i in0..< N div2:
x.data[i] = y.data[i]
let a =Foo[4](data: [1, 2, 3, 4])
echo a
echo a.lo # OKvar b: Foo[4]
echo b.lo # crash
b.lo = a.lo # crash
The following test case generates a null pointer dereference in the C code which results in SIGSEGV:
It should probably be catched by #124 or #7373, but I'm not sure how to slice part of
an array with compile-time known boundaries in a way compatible with JS and compile-time function evaluation.
The text was updated successfully, but these errors were encountered: