File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1+ 2015-06-25 Kevin Ushey <
[email protected] >
2+
3+ * inst/include/Rcpp/Function.h: catch empty error messages
4+ * inst/include/Rcpp/api/meat/Rcpp_eval.h: protect call
5+
162015-06-18 Dirk Eddelbuettel <
[email protected] >
27
38 * R/Attributes.R (evalCpp): Add support for plugings argument
Original file line number Diff line number Diff line change @@ -75,7 +75,8 @@ namespace Rcpp{
7575 }
7676
7777 SEXP operator ()() const {
78- return Rcpp_eval ( Rf_lang1 ( Storage::get__ () ) ) ;
78+ Shield<SEXP> call (Rf_lang1 (Storage::get__ ()));
79+ return Rcpp_eval (call);
7980 }
8081
8182 #include < Rcpp/generated/Function__operator.h>
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ namespace Rcpp{
2727 SEXP env;
2828 SEXP result;
2929 std::vector<std::string> warnings;
30+ bool error_occurred;
3031 std::string error_message;
3132 };
3233
@@ -80,8 +81,10 @@ namespace Rcpp{
8081 Shield<SEXP> current_error ( rcpp_get_current_error () ) ;
8182 Shield<SEXP> conditionMessageCall (::Rf_lang2 (conditionMessageSym, current_error)) ;
8283 Shield<SEXP> condition_message (::Rf_eval (conditionMessageCall, R_GlobalEnv)) ;
84+ evalCall->error_occurred = true ;
8385 evalCall->error_message = std::string (CHAR (::Rf_asChar (condition_message)));
8486 } else {
87+ evalCall->error_occurred = false ;
8588 evalCall->result = res;
8689 }
8790 }
@@ -102,7 +105,7 @@ namespace Rcpp{
102105
103106 // handle error or result if it completed, else throw interrupt
104107 if (completed) {
105- if (! call.error_message . empty () )
108+ if (call.error_occurred )
106109 throw eval_error (call.error_message );
107110 else
108111 return call.result ;
You can’t perform that action at this time.
0 commit comments