Skip to content

Commit 42172b2

Browse files
author
kalibera
committed
PROTECT fix.
git-svn-id: https://svn.r-project.org/R/trunk@87298 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent a179ca9 commit 42172b2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/main/eval.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5829,12 +5829,15 @@ static R_INLINE SEXP getvar(SEXP symbol, SEXP rho,
58295829
return PRVALUE(value);
58305830
else {
58315831
/**** R_isMissing is inefficient */
5832-
if (keepmiss && R_isMissing(symbol, rho))
5833-
return R_MissingArg;
5834-
else {
5835-
forcePromise(value);
5836-
return PRVALUE(value);
5832+
if (keepmiss) {
5833+
PROTECT(value);
5834+
Rboolean miss = R_isMissing(symbol, rho);
5835+
UNPROTECT(1);
5836+
if (miss)
5837+
return R_MissingArg;
58375838
}
5839+
forcePromise(value);
5840+
return PRVALUE(value);
58385841
}
58395842
}
58405843
else {

0 commit comments

Comments
 (0)