diff options
Diffstat (limited to 'src/lib_string.c')
-rw-r--r-- | src/lib_string.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/lib_string.c b/src/lib_string.c index ab353c20..1231aeb2 100644 --- a/src/lib_string.c +++ b/src/lib_string.c | |||
@@ -774,7 +774,6 @@ LJLIB_CF(string_format) | |||
774 | LUALIB_API int luaopen_string(lua_State *L) | 774 | LUALIB_API int luaopen_string(lua_State *L) |
775 | { | 775 | { |
776 | GCtab *mt; | 776 | GCtab *mt; |
777 | GCstr *mmstr; | ||
778 | global_State *g; | 777 | global_State *g; |
779 | LJ_LIB_REG(L, string); | 778 | LJ_LIB_REG(L, string); |
780 | #if defined(LUA_COMPAT_GFIND) | 779 | #if defined(LUA_COMPAT_GFIND) |
@@ -785,9 +784,7 @@ LUALIB_API int luaopen_string(lua_State *L) | |||
785 | /* NOBARRIER: basemt is a GC root. */ | 784 | /* NOBARRIER: basemt is a GC root. */ |
786 | g = G(L); | 785 | g = G(L); |
787 | setgcref(basemt_it(g, LJ_TSTR), obj2gco(mt)); | 786 | setgcref(basemt_it(g, LJ_TSTR), obj2gco(mt)); |
788 | mmstr = strref(g->mmname[MM_index]); | 787 | settabV(L, lj_tab_setstr(L, mt, mmname_str(g, MM_index)), tabV(L->top-1)); |
789 | if (isdead(g, obj2gco(mmstr))) flipwhite(obj2gco(mmstr)); | ||
790 | settabV(L, lj_tab_setstr(L, mt, mmstr), tabV(L->top-1)); | ||
791 | mt->nomm = cast_byte(~(1u<<MM_index)); | 788 | mt->nomm = cast_byte(~(1u<<MM_index)); |
792 | return 1; | 789 | return 1; |
793 | } | 790 | } |