diff --git a/3rd/lua/lgc.c b/3rd/lua/lgc.c index 235ee896..6370db74 100644 --- a/3rd/lua/lgc.c +++ b/3rd/lua/lgc.c @@ -65,7 +65,7 @@ */ #define maskcolors (~(bitmask(BLACKBIT) | WHITEBITS)) #define makewhite(g,x) \ - (x->marked = cast_byte((x->marked & maskcolors) | luaC_white(g))) + (x->marked = cast_byte((x->marked & maskcolors) | (x->marked & bitmask(SHAREBIT)) | luaC_white(g))) #define white2gray(x) resetbits(x->marked, WHITEBITS) #define black2gray(x) resetbit(x->marked, BLACKBIT) @@ -756,7 +756,7 @@ static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) { freeobj(L, curr); /* erase 'curr' */ } else { /* change mark to 'white' */ - curr->marked = cast_byte((marked & maskcolors) | white); + curr->marked = cast_byte((marked & maskcolors) | (marked & bitmask(SHAREBIT)) |white); p = &curr->next; /* go to next element */ } }