Hi all, Is it a bug to cause a segfault with Rcpp? Or are am I doing something so dumb that an automatic check could never protect? See minimal reproducible example below.
Hadley library(inline) f <- cxxfunction(signature(x = "numeric", i = "numeric"), plugin = "Rcpp", ' Rcpp::NumericVector x_(x); Rcpp::NumericVector i_(i); x_[(int) (i_[0]) - 1] = 1000; return(x_); ') f(1:10, 1) # works f(1:10, 1.5) # also works f(1:10, NA) # segfaults -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/ _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel