diff options
Diffstat (limited to 'lstring.c')
-rw-r--r-- | lstring.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.c,v 2.52 2015/09/17 15:51:05 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 2.53 2015/09/22 14:18:24 roberto Exp roberto $ |
3 | ** String table (keeps all strings handled by Lua) | 3 | ** String table (keeps all strings handled by Lua) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -160,6 +160,7 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) { | |||
160 | global_State *g = G(L); | 160 | global_State *g = G(L); |
161 | unsigned int h = luaS_hash(str, l, g->seed); | 161 | unsigned int h = luaS_hash(str, l, g->seed); |
162 | TString **list = &g->strt.hash[lmod(h, g->strt.size)]; | 162 | TString **list = &g->strt.hash[lmod(h, g->strt.size)]; |
163 | lua_assert(str != NULL); /* otherwise 'memcmp'/'memcpy' are undefined */ | ||
163 | for (ts = *list; ts != NULL; ts = ts->u.hnext) { | 164 | for (ts = *list; ts != NULL; ts = ts->u.hnext) { |
164 | if (l == ts->shrlen && | 165 | if (l == ts->shrlen && |
165 | (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) { | 166 | (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) { |