Skip to content

Commit c6f0e60

Browse files
authored
Merge pull request #953 from RcppCore/bugfix/rcpp_end_nprot_stop
use nprot and reference stop_sym (closes #951)
2 parents 0837b35 + 6674443 commit c6f0e60

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2019-03-18 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/include/Rcpp/macros/macros.h (END_RCPP_RETURN_ERROR): Add
4+
UNPROTECT to reference nprot, also check for stop_sym
5+
16
2019-03-17 Dirk Eddelbuettel <[email protected]>
27

38
* DESCRIPTION: Release 1.0.1

inst/include/Rcpp/macros/macros.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@
9898
catch (...) { \
9999
return string_to_try_error("c++ exception (unknown reason)"); \
100100
} \
101-
return R_NilValue;
101+
UNPROTECT(nprot); \
102+
return R_NilValue; \
103+
(void) stop_sym; /* never reached but suppresses warning */
102104
#endif
103105

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

0 commit comments

Comments
 (0)