Skip to content

Commit

Permalink
PROTECT fix.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87298 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
kalibera committed Nov 7, 2024
1 parent a179ca9 commit 42172b2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/main/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -5829,12 +5829,15 @@ static R_INLINE SEXP getvar(SEXP symbol, SEXP rho,
return PRVALUE(value);
else {
/**** R_isMissing is inefficient */
if (keepmiss && R_isMissing(symbol, rho))
return R_MissingArg;
else {
forcePromise(value);
return PRVALUE(value);
if (keepmiss) {
PROTECT(value);
Rboolean miss = R_isMissing(symbol, rho);
UNPROTECT(1);
if (miss)
return R_MissingArg;
}
forcePromise(value);
return PRVALUE(value);
}
}
else {
Expand Down

0 comments on commit 42172b2

Please sign in to comment.