Re: [Rcpp-devel] Error when handling default values

2014-02-03 Thread Dirk Eddelbuettel
Hi Alessandro, Briefly-ish as I am at work: On 3 February 2014 at 19:17, Alessandro Mammana wrote: | Hi all, | once again I have a bug and no idea what I am doing wrong. | I started to handle optional arguments directly at the C++ level, so | that I don't have to write a wrapper function in R. T

Re: [Rcpp-devel] Error when handling default values

2014-02-03 Thread Kevin Ushey
When I run this (with latest CRAN Rcpp, 0.11.0), I get the error: Error: index out of bounds My best guess: you are casting things to SEXP, which removes the protection guarantees that Rcpp offers you, and so these objects are getting gc'ed without you expecting it. IIUC, casting with (SEXP)

[Rcpp-devel] Error when handling default values

2014-02-03 Thread Alessandro Mammana
Hi all, once again I have a bug and no idea what I am doing wrong. I started to handle optional arguments directly at the C++ level, so that I don't have to write a wrapper function in R. The pattern below has always worked so far, but today it crashed. It was very hard to reproduce, It took ages t