Skip to content

Commit 69d2c94

Browse files
committed
protect the temporary SEXPs produced by wrap
1 parent 2645fce commit 69d2c94

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2017-12-04 Kevin Ushey <[email protected]>
2+
3+
* inst/include/Rcpp/api/meat/proxy.h: Protect temporary SEXP
4+
* inst/include/Rcpp/proxy/ProtectedProxy.h: Idem
5+
* inst/include/Rcpp/vector/generic_proxy.h: Idem
6+
17
2017-12-03 Dirk Eddelbuettel <[email protected]>
28

39
* DESCRIPTION (Version, Date): New minor version

inst/include/Rcpp/api/meat/proxy.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ template <typename CLASS>
3030
template <typename T>
3131
typename AttributeProxyPolicy<CLASS>::AttributeProxy&
3232
AttributeProxyPolicy<CLASS>::AttributeProxy::operator=(const T& rhs) {
33-
set( wrap(rhs) );
33+
set(Shield<SEXP>(wrap(rhs)));
3434
return *this;
3535
}
3636

@@ -61,7 +61,7 @@ template <typename CLASS>
6161
template <typename T>
6262
typename NamesProxyPolicy<CLASS>::NamesProxy&
6363
NamesProxyPolicy<CLASS>::NamesProxy::operator=(const T& rhs) {
64-
set( wrap(rhs) );
64+
set(Shield<SEXP>(wrap(rhs)));
6565
return *this;
6666
}
6767

@@ -82,7 +82,7 @@ template <typename CLASS>
8282
template <typename T>
8383
typename SlotProxyPolicy<CLASS>::SlotProxy&
8484
SlotProxyPolicy<CLASS>::SlotProxy::operator=(const T& rhs) {
85-
set(wrap(rhs));
85+
set(Shield<SEXP>(wrap(rhs)));
8686
return *this;
8787
}
8888

@@ -97,7 +97,7 @@ template <typename CLASS>
9797
template <typename T>
9898
typename TagProxyPolicy<CLASS>::TagProxy&
9999
TagProxyPolicy<CLASS>::TagProxy::operator=(const T& rhs) {
100-
set( wrap(rhs) );
100+
set(Shield<SEXP>(wrap(rhs)));
101101
return *this;
102102
}
103103

@@ -128,7 +128,7 @@ template <typename CLASS>
128128
template <typename T>
129129
typename BindingPolicy<CLASS>::Binding&
130130
BindingPolicy<CLASS>::Binding::operator=(const T& rhs) {
131-
set(wrap(rhs));
131+
set(Shield<SEXP>(wrap(rhs)));
132132
return *this;
133133
}
134134

@@ -149,15 +149,15 @@ template <typename CLASS>
149149
template <typename T>
150150
typename DottedPairProxyPolicy<CLASS>::DottedPairProxy&
151151
DottedPairProxyPolicy<CLASS>::DottedPairProxy::operator=(const T& rhs) {
152-
set(wrap(rhs));
152+
set(Shield<SEXP>(wrap(rhs)));
153153
return *this;
154154
}
155155

156156
template <typename CLASS>
157157
template <typename T>
158158
typename DottedPairProxyPolicy<CLASS>::DottedPairProxy&
159159
DottedPairProxyPolicy<CLASS>::DottedPairProxy::operator=(const traits::named_object<T>& rhs) {
160-
return set(wrap(rhs.object), rhs.name);
160+
return set(Shield<SEXP>(wrap(rhs.object)), rhs.name);
161161
}
162162

163163
template <typename CLASS>

inst/include/Rcpp/proxy/ProtectedProxy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace Rcpp{
3232

3333
template <typename U>
3434
ProtectedProxy& operator=( const U& u) {
35-
set( wrap( u ) );
35+
set(Shield<SEXP>(wrap(u)));
3636
return *this;
3737
}
3838

inst/include/Rcpp/vector/generic_proxy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace internal{
4747

4848
template <typename T>
4949
generic_proxy& operator=( const T& rhs){
50-
set(wrap(rhs)) ;
50+
set(Shield<SEXP>(wrap(rhs))) ;
5151
return *this;
5252
}
5353

0 commit comments

Comments
 (0)