Skip to content

Commit dd7b0d2

Browse files
committed
protect Rf_mkString inside Rf_lang2
1 parent f2ed04f commit dd7b0d2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* DESCRIPTION (Version, Date): Roll minor version
44

55
* inst/include/Rcpp/Reference.h: Shield Rf_mkstring inside Rf_lang2
6+
* inst/include/Rcpp/Environment.h: Idem (inside Rf_lang4)
67
2019-10-31 Romain Francois <[email protected]>
78

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

inst/include/Rcpp/Environment.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
//
33
// Environment.h: Rcpp R/C++ interface class library -- access R environments
44
//
5-
// Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois
6-
// Copyright (C) 2014 Dirk Eddelbuettel, Romain Francois and Kevin Ushey
5+
// Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois
6+
// Copyright (C) 2014 - 2019 Dirk Eddelbuettel, Romain Francois and Kevin Ushey
77
//
88
// This file is part of Rcpp.
99
//
@@ -246,9 +246,8 @@ namespace Rcpp{
246246
we have to go back to R to do this operation */
247247
SEXP internalSym = Rf_install( ".Internal" );
248248
SEXP removeSym = Rf_install( "remove" );
249-
Shield<SEXP> call( Rf_lang2(internalSym,
250-
Rf_lang4(removeSym, Rf_mkString(name.c_str()), Storage::get__(), Rf_ScalarLogical( FALSE ))
251-
) );
249+
Shield<SEXP> str(Rf_mkString(name.c_str()));
250+
Shield<SEXP> call(Rf_lang2(internalSym, Rf_lang4(removeSym, str, Storage::get__(), Rf_ScalarLogical(FALSE))));
252251
Rcpp_fast_eval( call, R_GlobalEnv ) ;
253252
}
254253
} else{

0 commit comments

Comments
 (0)