Solving merge issue with use of tables in dump/undump

The use of tables in dump/undump to reuse strings did not exist in
the version that changed the representation of arrays, so it was not
corrected for the new API for tables.
This commit is contained in:
Roberto Ierusalimschy
2023-11-08 10:02:06 -03:00
parent 37c215b43f
commit 19afd91687
2 changed files with 7 additions and 6 deletions

View File

@@ -143,8 +143,9 @@ static TString *loadStringN (LoadState *S, Proto *p) {
return NULL;
else if (size == 1) { /* previously saved string? */
int idx = loadInt(S); /* get its index */
const TValue *stv = luaH_getint(S->h, idx);
return tsvalue(stv);
TValue stv;
luaH_getint(S->h, idx, &stv);
return tsvalue(&stv);
}
else if (size -= 2, size <= LUAI_MAXSHORTLEN) { /* short string? */
char buff[LUAI_MAXSHORTLEN];