Skip to content

Commit 07a9eab

Browse files
committed
Cannot use 'getshrstr' before setting 'shrlen'
1 parent 9363a8b commit 07a9eab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lstring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) {
207207
list = &tb->hash[lmod(h, tb->size)]; /* rehash with new size */
208208
}
209209
ts = createstrobj(L, l, LUA_VSHRSTR, h);
210-
memcpy(getshrstr(ts), str, l * sizeof(char));
211210
ts->shrlen = cast_byte(l);
211+
memcpy(getshrstr(ts), str, l * sizeof(char));
212212
ts->u.hnext = *list;
213213
*list = ts;
214214
tb->nuse++;

0 commit comments

Comments
 (0)