Skip to content

Commit fd85616

Browse files
committed
Fixed rchk unprotected values in Rf_lang3
1 parent 43f86d2 commit fd85616

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SetUpUtils.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,9 @@ void SetRandomSample(SEXP RindexVec, SEXP RNumSamp, int &sampSize,
559559
cpp11::stop("n exceeds the maximum number of possible results");
560560
}
561561

562-
cpp11::sexp sample = Rf_lang3(baseSample,
563-
Rf_ScalarReal(computedRows),
564-
Rf_ScalarInteger(sampSize));
562+
cpp11::sexp sexpNRows = Rf_ScalarReal(computedRows);
563+
cpp11::sexp sexpNSize = Rf_ScalarInteger(sampSize);
564+
cpp11::sexp sample = Rf_lang3(baseSample, sexpNRows, sexpNSize);
565565
cpp11::sexp val = Rf_eval(sample, rho);
566566
mySample.resize(sampSize);
567567

0 commit comments

Comments
 (0)