Make metamethod names proper GC roots.

This commit is contained in:
Mike Pall
2010-04-25 18:35:47 +02:00
parent 87e4daf89c
commit ef0904e80b
12 changed files with 26 additions and 29 deletions

View File

@@ -88,7 +88,8 @@ GCstr *lj_str_new(lua_State *L, const char *str, size_t lenx)
for (o = gcref(g->strhash[h & g->strmask]); o != NULL; o = gcnext(o)) {
GCstr *tso = gco2str(o);
if (tso->len == len && (memcmp(str, strdata(tso), len) == 0)) {
if (isdead(g, o)) flipwhite(o); /* Resurrect if dead. */
/* Resurrect if dead. Can only happen with fixstring() (keywords). */
if (isdead(g, o)) flipwhite(o);
return tso; /* Return existing string. */
}
}