Skip to content

Commit 2bbc244

Browse files
committed
Merge pull request #208 from RcppCore/feature/protect-grow
additional protection via Shield<SEXP> for tail objects, as suggested by...
2 parents b5eed11 + e31374c commit 2bbc244

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2014-11-25 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/include/Rcpp/grow.h: Apply additional Shield<> use around tail
4+
object as suggested by Martin Morgan on the rcpp-devel list
5+
16
2014-11-24 Dirk Eddelbuettel <[email protected]>
27

38
* inst/include/Rcpp/config.h: Release version is still 0.11.3

inst/NEWS.Rd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
\item \code{Rcpp::stop} now supports improved \code{printf}-like syntax
1515
using the small tinyformat header-only library (following a similar
1616
implementation in Rcpp11)
17+
\item Pairlist objects are now protected via an additional \code{Shield<>}
18+
as suggested by Martin Morgan on the rcpp-devel list.
1719
}
1820
\item Changes in Rcpp Attributes:
1921
\itemize{

inst/include/Rcpp/grow.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ namespace Rcpp {
6161
*/
6262
template <typename T>
6363
SEXP grow(const T& head, SEXP tail) {
64-
return internal::grow__dispatch( typename traits::is_named<T>::type(), head, tail );
64+
Shield<SEXP> y(tail);
65+
return internal::grow__dispatch(typename traits::is_named<T>::type(), head, y);
6566
}
6667

6768
inline SEXP grow( const char* head, SEXP tail ) {
68-
return grow( Rf_mkString(head), tail ) ;
69+
Shield<SEXP> y(tail);
70+
return grow(Rf_mkString(head), y);
6971
}
7072

7173
#include <Rcpp/generated/grow__pairlist.h>

0 commit comments

Comments
 (0)