summaryrefslogtreecommitdiff
path: root/src/lj_str.c
diff options
context:
space:
mode:
authorMike Pall <mike>2010-04-25 18:35:47 +0200
committerMike Pall <mike>2010-04-25 18:35:47 +0200
commitef0904e80ba5996c27999a1f044e03761b84826f (patch)
tree1b5bd59d7e8df1fddcca27dfe1d82a3bc3990253 /src/lj_str.c
parent87e4daf89c9f37e417993dedc9c5369da89ebca2 (diff)
downloadluajit2-ef0904e80ba5996c27999a1f044e03761b84826f.tar.gz
Make metamethod names proper GC roots.
Diffstat (limited to 'src/lj_str.c')
-rw-r--r--src/lj_str.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_str.c b/src/lj_str.c
index 9aa62582..7b38cecc 100644
--- a/src/lj_str.c
+++ b/src/lj_str.c
@@ -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. */
}
}