diff --git a/src/eval.jl b/src/eval.jl index b75e6d81..28847bc5 100644 --- a/src/eval.jl +++ b/src/eval.jl @@ -111,7 +111,7 @@ Evaluate an R expression array iteratively. If `throw_error` is `false`, the error message and warning will be thrown to stderr. """ function reval_p(expr::Ptr{ExprSxp}, env::Ptr{EnvSxp}) - local val + val = nothing protect(expr) protect(env) try @@ -122,7 +122,7 @@ function reval_p(expr::Ptr{ExprSxp}, env::Ptr{EnvSxp}) unprotect(2) end # set .Last.value - if env == Const.GlobalEnv.p + if val !== nothing && env == Const.GlobalEnv.p set_last_value(val) end val