diff options
author | Mike Pall <mike> | 2010-04-25 18:35:47 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2010-04-25 18:35:47 +0200 |
commit | ef0904e80ba5996c27999a1f044e03761b84826f (patch) | |
tree | 1b5bd59d7e8df1fddcca27dfe1d82a3bc3990253 /src/lj_str.c | |
parent | 87e4daf89c9f37e417993dedc9c5369da89ebca2 (diff) | |
download | luajit-ef0904e80ba5996c27999a1f044e03761b84826f.tar.gz luajit-ef0904e80ba5996c27999a1f044e03761b84826f.tar.bz2 luajit-ef0904e80ba5996c27999a1f044e03761b84826f.zip |
Make metamethod names proper GC roots.
Diffstat (limited to 'src/lj_str.c')
-rw-r--r-- | src/lj_str.c | 3 |
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) | |||
88 | for (o = gcref(g->strhash[h & g->strmask]); o != NULL; o = gcnext(o)) { | 88 | for (o = gcref(g->strhash[h & g->strmask]); o != NULL; o = gcnext(o)) { |
89 | GCstr *tso = gco2str(o); | 89 | GCstr *tso = gco2str(o); |
90 | if (tso->len == len && (memcmp(str, strdata(tso), len) == 0)) { | 90 | if (tso->len == len && (memcmp(str, strdata(tso), len) == 0)) { |
91 | if (isdead(g, o)) flipwhite(o); /* Resurrect if dead. */ | 91 | /* Resurrect if dead. Can only happen with fixstring() (keywords). */ |
92 | if (isdead(g, o)) flipwhite(o); | ||
92 | return tso; /* Return existing string. */ | 93 | return tso; /* Return existing string. */ |
93 | } | 94 | } |
94 | } | 95 | } |