Skip to content

Commit

Permalink
use nprot and reference stop_sym (closes #951)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Mar 18, 2019
1 parent 0837b35 commit 47f6e91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2019-03-18 Dirk Eddelbuettel <edd@debian.org>

* inst/include/Rcpp/macros/macros.h (END_RCPP_RETURN_ERROR): Add
UNPROTECT to reference nprot, also check for stop_sym

2019-03-17 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION: Release 1.0.1
Expand Down
5 changes: 4 additions & 1 deletion inst/include/Rcpp/macros/macros.h
Expand Up @@ -98,7 +98,10 @@
catch (...) { \
return string_to_try_error("c++ exception (unknown reason)"); \
} \
return R_NilValue;
UNPROTECT(nprot); \
return R_NilValue; \
if (stop_sym == R_NilValue) /* never reached but */ \
return R_NilValue; /* suppresses warning*/
#endif

#define Rcpp_error(MESSAGE) throw Rcpp::exception(MESSAGE, __FILE__, __LINE__)
Expand Down

0 comments on commit 47f6e91

Please sign in to comment.