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 3d5e62f commit b735942Copy full SHA for b735942
inst/include/Rcpp/vector/no_init.h
@@ -62,7 +62,11 @@ class no_init_matrix {
62
63
template <int RTYPE, template <class> class StoragePolicy >
64
operator Matrix<RTYPE, StoragePolicy>() const {
65
- return Rf_allocMatrix(RTYPE, nr, nc);
+ // Explicitly protect temporary matrix to avoid false positive
66
+ // with rchk (#892)
67
+ Shield<SEXP> x(Rf_allocMatrix(RTYPE, nr, nc));
68
+ Matrix<RTYPE, PreserveStorage> ret(x);
69
+ return ret;
70
}
71
72
private:
0 commit comments