Skip to content

Commit 0725728

Browse files
authored
Merge pull request #706 from krlmlr/b-stack-trace-protect
Protect function argument to rcpp_set_stack_trace()
2 parents 7687508 + 66cf2c6 commit 0725728

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

inst/NEWS.Rd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
\item Changes in Rcpp API:
99
\itemize{
1010
\item The \code{tinyformat.h} header now ends in a newline (\ghit{701}).
11+
\item Fixed rare protection error that occurred when fetching stack traces during the construction of an Rcpp exception (Kirill Müller in \ghit{706}).
1112
}
1213
\item Changes in Rcpp Attributes:
1314
\itemize{

inst/include/Rcpp/exceptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ namespace Rcpp {
3131
explicit exception(const char* message_, bool include_call = true) : // #nocov start
3232
message(message_),
3333
include_call_(include_call){
34-
rcpp_set_stack_trace(stack_trace());
34+
rcpp_set_stack_trace(Shield<SEXP>(stack_trace()));
3535
}
3636
exception(const char* message_, const char* file, int line, bool include_call = true) :
3737
message(message_),
3838
include_call_(include_call){
39-
rcpp_set_stack_trace(stack_trace(file,line));
39+
rcpp_set_stack_trace(Shield<SEXP>(stack_trace()));
4040
}
4141
bool include_call() const {
4242
return include_call_;

0 commit comments

Comments
 (0)