Skip to content

Commit f2ed04f

Browse files
committed
protect Rf_mkString inside Rf_lang2
1 parent 76c0ab1 commit f2ed04f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
* DESCRIPTION (Version, Date): Roll minor version
44

5+
* inst/include/Rcpp/Reference.h: Shield Rf_mkstring inside Rf_lang2
56
2019-10-31 Romain Francois <[email protected]>
67

78
* inst/include/Rcpp/DataFrame.h: Protect temporaries from gc

inst/include/Rcpp/Reference.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Reference.h: Rcpp R/C++ interface class library -- Reference class objects
44
//
5-
// Copyright (C) 2010 - 2015 Dirk Eddelbuettel and Romain Francois
5+
// Copyright (C) 2010 - 2019 Dirk Eddelbuettel and Romain Francois
66
//
77
// This file is part of Rcpp.
88
//
@@ -58,7 +58,8 @@ namespace Rcpp{
5858
*/
5959
Reference_Impl( const std::string& klass ) {
6060
SEXP newSym = Rf_install("new");
61-
Shield<SEXP> call( Rf_lang2( newSym, Rf_mkString( klass.c_str() ) ) );
61+
Shield<SEXP> str(Rf_mkString(klass.c_str()));
62+
Shield<SEXP> call(Rf_lang2(newSym, str));
6263
Storage::set__( Rcpp_fast_eval( call , Rcpp::internal::get_Rcpp_namespace()) );
6364
}
6465

0 commit comments

Comments
 (0)