mirror of https://github.com/rusefi/lua.git
Cannot use 'getshrstr' before setting 'shrlen'
This commit is contained in:
parent
9363a8b990
commit
07a9eab23a
|
@ -207,8 +207,8 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) {
|
||||||
list = &tb->hash[lmod(h, tb->size)]; /* rehash with new size */
|
list = &tb->hash[lmod(h, tb->size)]; /* rehash with new size */
|
||||||
}
|
}
|
||||||
ts = createstrobj(L, l, LUA_VSHRSTR, h);
|
ts = createstrobj(L, l, LUA_VSHRSTR, h);
|
||||||
memcpy(getshrstr(ts), str, l * sizeof(char));
|
|
||||||
ts->shrlen = cast_byte(l);
|
ts->shrlen = cast_byte(l);
|
||||||
|
memcpy(getshrstr(ts), str, l * sizeof(char));
|
||||||
ts->u.hnext = *list;
|
ts->u.hnext = *list;
|
||||||
*list = ts;
|
*list = ts;
|
||||||
tb->nuse++;
|
tb->nuse++;
|
||||||
|
|
Loading…
Reference in New Issue