kevinushey/RcppRoll

segfault -- vector length smaller than window length

my-R-help opened this issue · 2 comments

If you repeatedly call a rolling function, e.g. roll_sumr and the vector length is smaller than the window length, then after some time it will segfault.

If the segfault bug is fixed, I think the current behavior of the dev version on github is better than v0.1.0 on CRAN, i.e. to just return a NA-vector (of appropriate class) that has the vector length (as opposed to the longer window length).

Should be sorted out now! If window size is greater than vector size, we just return an NA vector of same length as the vector.

Thanks, works also with the example data I've sent you earlier.