summaryrefslogtreecommitdiff
path: root/libs/liblua/src/lfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/liblua/src/lfunc.c')
-rw-r--r--libs/liblua/src/lfunc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/liblua/src/lfunc.c b/libs/liblua/src/lfunc.c
index 10100e5aca..88d45328b1 100644
--- a/libs/liblua/src/lfunc.c
+++ b/libs/liblua/src/lfunc.c
@@ -234,9 +234,10 @@ int luaF_close (lua_State *L, StkId level, int status) {
luaF_unlinkupval(uv);
setobj(L, slot, uv->v); /* move value to upvalue slot */
uv->v = slot; /* now current value lives here */
- if (!iswhite(uv))
- gray2black(uv); /* closed upvalues cannot be gray */
- luaC_barrier(L, uv, slot);
+ if (!iswhite(uv)) { /* neither white nor dead? */
+ nw2black(uv); /* closed upvalues cannot be gray */
+ luaC_barrier(L, uv, slot);
+ }
}
return status;
}