/* check color (and invariants) for an upvalue that was closed, i.e., moved into the 'allgc' list  */
void luaC_checkupvalcolor(global_State *g, UpVal *uv)
/* check color (and invariants) for an upvalue that was closed, i.e., moved into the 'allgc' list  */
void luaC_checkupvalcolor(global_State *g, UpVal *uv)
{
    if (keepinvariant(g)) {
      resetoldbit(o);
      gray2black(o);
      markvalue(g, uv->v);
    }
    else {
      lua_assert(issweepphase(g));
      makewhite(g, o);
    }
  }
}