Skip to content

Commit 97f9a81

Browse files
protect call in convert_using_rfunction()
1 parent 21400f2 commit 97f9a81

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

inst/include/Rcpp/r_cast.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ namespace Rcpp {
3131
Armor<SEXP> res;
3232
try{
3333
SEXP funSym = Rf_install(fun);
34-
res = Rcpp_fast_eval(Rf_lang2(funSym, x), R_GlobalEnv);
34+
Shield<SEXP> call(Rf_lang2(funSym, x));
35+
res = Rcpp_fast_eval(call, R_GlobalEnv);
3536
} catch( eval_error& e) {
3637
const char* fmt = "Could not convert using R function: %s.";
3738
throw not_compatible(fmt, fun);

0 commit comments

Comments
 (0)