|
@@ -497,10 +497,10 @@ static void traverseweakvalue (global_State *g, Table *h) {
|
|
|
hasclears = 1; /* table will have to be cleared */
|
|
|
}
|
|
|
}
|
|
|
- if (g->gcstate == GCSatomic && hasclears)
|
|
|
- linkgclist(h, g->weak); /* has to be cleared later */
|
|
|
- else
|
|
|
+ if (g->gcstate == GCSpropagate)
|
|
|
linkgclist(h, g->grayagain); /* must retraverse it in atomic phase */
|
|
|
+ else if (hasclears)
|
|
|
+ linkgclist(h, g->weak); /* has to be cleared later */
|
|
|
}
|
|
|
|
|
|
|