do not makeshared to LUA_TSHRSTR

This commit is contained in:
hong
2019-05-27 16:34:27 +08:00
committed by 云风
parent 1b60c522b0
commit fafc4cad34
2 changed files with 2 additions and 2 deletions

View File

@@ -950,7 +950,6 @@ new_string(unsigned int h, const char *str, lu_byte l) {
memset(ts, 0, sz); memset(ts, 0, sz);
setbits(ts->marked, WHITEBITS); setbits(ts->marked, WHITEBITS);
gray2black(ts); gray2black(ts);
makeshared(ts);
ts->tt = LUA_TSHRSTR; ts->tt = LUA_TSHRSTR;
ts->hash = h; ts->hash = h;
ts->shrlen = l; ts->shrlen = l;

View File

@@ -47,7 +47,8 @@ mark_shared(lua_State *L) {
case LUA_TSTRING: { case LUA_TSTRING: {
const char *str = lua_tostring(L, idx); const char *str = lua_tostring(L, idx);
TString *ts = (TString *)(str - sizeof(UTString)); TString *ts = (TString *)(str - sizeof(UTString));
makeshared(ts); if(ts->tt==LUA_TLNGSTR)
makeshared(ts);
break; break;
} }
default: default: