We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e74cdd commit a23f6afCopy full SHA for a23f6af
inst/include/cpp11/attribute_proxy.hpp
@@ -26,15 +26,17 @@ class attribute_proxy {
26
27
template <typename C>
28
attribute_proxy& operator=(C rhs) {
29
- // NOPROTECT: Rf_setAttrib with a SYMSXP does not allocate
30
- Rf_setAttrib(parent_.data(), symbol_, as_sexp(rhs));
+ SEXP value = PROTECT(as_sexp(rhs));
+ Rf_setAttrib(parent_.data(), symbol_, value);
31
+ UNPROTECT(1);
32
return *this;
33
}
34
35
36
attribute_proxy& operator=(std::initializer_list<C> rhs) {
37
38
39
40
41
42
0 commit comments