Trying to write into a vector beyond its length is protected against - it seems that the write simply doesn't happen.
However, if the length of the vector is 0, then there is a segfault. We might see if we can protect against this.
myfun <- nFunction(
fun = function() {
y = numeric(length=0)
y[3] = 7
return(y)
}, returnType = 'numericVector')
Trying to write into a vector beyond its length is protected against - it seems that the write simply doesn't happen.
However, if the length of the vector is 0, then there is a segfault. We might see if we can protect against this.