eliminate unsafe usages of 'Rf_eval' #498

Closed
kevinushey opened this Issue Jun 29, 2016 · 0 comments

Projects

None yet

1 participant

@kevinushey
Contributor
kevinushey commented Jun 29, 2016 edited

There are a number of places in Rcpp where we use Rf_eval rather than the more appropriate / safer Rcpp_eval:

$ ag -Q "Rf_eval"
inst/include/Rcpp/api/meat/Rcpp_eval.h
57:    Shield<SEXP> res(::Rf_eval(call, R_GlobalEnv));
69:            Shield<SEXP> conditionMessage(::Rf_eval(conditionMessageCall, R_GlobalEnv));

inst/include/Rcpp/Environment.h
114:                res = Rf_eval( res, env ) ;
135:                res = Rf_eval( res, env ) ;
206:                    Rf_eval( call, R_GlobalEnv ) ;

inst/include/Rcpp/exceptions.h
132:    Rcpp::Shield<SEXP> calls( Rf_eval( sys_calls_expr, R_GlobalEnv ) );
197:    Rcpp::Shield<SEXP> simpleError( Rf_eval(simpleErrorExpr, R_GlobalEnv) );
326:    Rf_eval( expr, R_GlobalEnv ) ;

inst/include/Rcpp/Language.h
148:            return Rf_eval( Storage::get__(), R_GlobalEnv) ;
151:            return Rf_eval( Storage::get__(), env) ;

inst/include/Rcpp/macros/macros.h
55:       Rf_eval( expr, R_GlobalEnv ) ;                                                            \

inst/include/Rcpp/Module.h
457:    Rf_eval(__load_module_call__), R_GlobalEnv );

inst/include/Rcpp/proxy/FieldProxy.h
45:            return Rf_eval( call, R_GlobalEnv ) ;
50:            parent.set__( Rf_eval( call, R_GlobalEnv ) );
70:            return Rf_eval( call, R_GlobalEnv ) ;

inst/include/Rcpp/r_cast.h
98:                    Shield<SEXP> res( Rf_eval( call, R_GlobalEnv ) ) ;

inst/unitTests/cpp/language.cpp
71:    return Rf_eval( call, R_GlobalEnv ) ;

src/barrier.cpp
98:        Rcpp::Shield<SEXP> RCPP(Rf_eval(call, R_GlobalEnv));
140:    Rcpp::Shield<SEXP> RCPP(Rf_eval(call, R_GlobalEnv));

Most of these (barring ones used directly for R error / exception handling) should likely be Rcpp_eval.

@kevinushey kevinushey changed the title from deprecate / slate for removal APIs that use 'Rf_eval' directly to eliminate unsafe usages of 'Rf_eval' Jun 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment