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
+
1
6
2015-06-18 Dirk Eddelbuettel <
[email protected] >
2
7
3
8
* 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{
75
75
}
76
76
77
77
SEXP operator ()() const {
78
- return Rcpp_eval ( Rf_lang1 ( Storage::get__ () ) ) ;
78
+ Shield<SEXP> call (Rf_lang1 (Storage::get__ ()));
79
+ return Rcpp_eval (call);
79
80
}
80
81
81
82
#include < Rcpp/generated/Function__operator.h>
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ namespace Rcpp{
27
27
SEXP env;
28
28
SEXP result;
29
29
std::vector<std::string> warnings;
30
+ bool error_occurred;
30
31
std::string error_message;
31
32
};
32
33
@@ -80,8 +81,10 @@ namespace Rcpp{
80
81
Shield<SEXP> current_error ( rcpp_get_current_error () ) ;
81
82
Shield<SEXP> conditionMessageCall (::Rf_lang2 (conditionMessageSym, current_error)) ;
82
83
Shield<SEXP> condition_message (::Rf_eval (conditionMessageCall, R_GlobalEnv)) ;
84
+ evalCall->error_occurred = true ;
83
85
evalCall->error_message = std::string (CHAR (::Rf_asChar (condition_message)));
84
86
} else {
87
+ evalCall->error_occurred = false ;
85
88
evalCall->result = res;
86
89
}
87
90
}
@@ -102,7 +105,7 @@ namespace Rcpp{
102
105
103
106
// handle error or result if it completed, else throw interrupt
104
107
if (completed) {
105
- if (! call.error_message . empty () )
108
+ if (call.error_occurred )
106
109
throw eval_error (call.error_message );
107
110
else
108
111
return call.result ;
You can’t perform that action at this time.
0 commit comments