Skip to content

Commit 30bd875

Browse files
committed
Bandaid for protection issue in FieldProxy (#121)
1 parent 4c595eb commit 30bd875

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2014-03-05 Kevin Ushey <[email protected]>
2+
3+
* inst/include/Rcpp/proxy/FieldProxy.h: bandaid for protection issue
4+
in operator= of FieldProxy
5+
16
2014-03-03 Kevin Ushey <[email protected]>
27

38
* inst/include/Rcpp/proxy/SlotProxy.h: Add missing const_SlotProxy ctor

inst/include/Rcpp/proxy/FieldProxy.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ class FieldProxyPolicy {
3535
}
3636

3737
template <typename T> FieldProxy& operator=(const T& rhs) {
38-
set( wrap(rhs) );
39-
return *this;
38+
SEXP tmp = PROTECT( wrap(rhs) );
39+
set(tmp);
40+
UNPROTECT(1);
41+
return *this;
4042
}
4143

4244
template <typename T> operator T() const {

0 commit comments

Comments
 (0)