Skip to content

Commit 3f58dea

Browse files
committed
Use safe evaluation instead of Rf_eval()
1 parent c3dd7ab commit 3f58dea

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
* inst/include/RcppCommon.h: Add Rcpp_fast_eval() to the public API and
4040
internal::Rcpp_eval_impl() to the private API.
4141

42+
* inst/include/Rcpp/Environment.h: Use safe evaluation
43+
* inst/include/Rcpp/Language.h: idem
44+
4245
2017-12-05 Kevin Ushey <[email protected]>
4346

4447
* inst/include/Rcpp/Environment.h: Use public R APIs

inst/include/Rcpp/Environment.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ namespace Rcpp{
109109

110110
/* We need to evaluate if it is a promise */
111111
if( TYPEOF(res) == PROMSXP){
112-
res = Rf_eval( res, env ) ;
112+
res = internal::Rcpp_eval_impl( res, env ) ;
113113
}
114114
return res ;
115115
}
@@ -129,7 +129,7 @@ namespace Rcpp{
129129

130130
/* We need to evaluate if it is a promise */
131131
if( TYPEOF(res) == PROMSXP){
132-
res = Rf_eval( res, env ) ;
132+
res = internal::Rcpp_eval_impl( res, env ) ;
133133
}
134134
return res ;
135135
}
@@ -151,7 +151,7 @@ namespace Rcpp{
151151

152152
/* We need to evaluate if it is a promise */
153153
if( TYPEOF(res) == PROMSXP){
154-
res = Rf_eval( res, env ) ;
154+
res = internal::Rcpp_eval_impl( res, env ) ;
155155
}
156156
return res ;
157157
}
@@ -174,7 +174,7 @@ namespace Rcpp{
174174

175175
/* We need to evaluate if it is a promise */
176176
if( TYPEOF(res) == PROMSXP){
177-
res = Rf_eval( res, env ) ;
177+
res = internal::Rcpp_eval_impl( res, env ) ;
178178
}
179179
return res ;
180180
}

inst/include/Rcpp/Language.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ namespace Rcpp{
145145
}
146146

147147
SEXP fast_eval() const {
148-
return Rf_eval( Storage::get__(), R_GlobalEnv) ;
148+
return internal::Rcpp_eval_impl( Storage::get__(), R_GlobalEnv) ;
149149
}
150150
SEXP fast_eval(SEXP env ) const {
151-
return Rf_eval( Storage::get__(), env) ;
151+
return internal::Rcpp_eval_impl( Storage::get__(), env) ;
152152
}
153153

154154
void update( SEXP x){

0 commit comments

Comments
 (0)