Commit 572cbc0a authored by Radford Neal's avatar Radford Neal

fix bug in byte code interpreter activated by recent changes

parent 6f8b8a36
......@@ -27,3 +27,6 @@ some correctness tests).
Makes variable lookup and creation return (sometimes) the binding
cell used, in R_binding_cell, so that short-cuts can sometimes be
Fixes a latent bug in byte-code interpreter activated by presence
of promises with NAMEDCNT == 1. Should also speed it up a bit.
......@@ -5158,6 +5158,8 @@ static SEXP bcEval(SEXP body, SEXP rho, Rboolean useCache)
SEXP symbol = VECTOR_ELT(constants, sidx);
SEXP cell = GET_BINDING_CELL_CACHE(symbol, rho, vcache, sidx);
value = BINDING_VALUE(cell);
if (TYPEOF(value) == PROMSXP)
value = forcePromise(value);
if (value == R_UnboundValue || NAMEDCNT(value) != 1) {
/* Used to call EnsureLocal, now changed, so old code is here. */
value = findVarInFrame3 (rho, symbol, TRUE);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment