aboutsummaryrefslogtreecommitdiff
path: root/lundump.c
diff options
context:
space:
mode:
Diffstat (limited to 'lundump.c')
-rw-r--r--lundump.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lundump.c b/lundump.c
index 3f18343a..f850dc4a 100644
--- a/lundump.c
+++ b/lundump.c
@@ -152,7 +152,7 @@ static void loadString (LoadState *S, Proto *p, TString **sl) {
152 luaH_getint(S->h, idx, &stv); 152 luaH_getint(S->h, idx, &stv);
153 *sl = ts = tsvalue(&stv); 153 *sl = ts = tsvalue(&stv);
154 luaC_objbarrier(L, p, ts); 154 luaC_objbarrier(L, p, ts);
155 return; 155 return; /* do not save it again */
156 } 156 }
157 else if ((size -= 2) <= LUAI_MAXSHORTLEN) { /* short string? */ 157 else if ((size -= 2) <= LUAI_MAXSHORTLEN) { /* short string? */
158 char buff[LUAI_MAXSHORTLEN + 1]; /* extra space for '\0' */ 158 char buff[LUAI_MAXSHORTLEN + 1]; /* extra space for '\0' */
@@ -168,10 +168,10 @@ static void loadString (LoadState *S, Proto *p, TString **sl) {
168 else { /* create internal copy */ 168 else { /* create internal copy */
169 *sl = ts = luaS_createlngstrobj(L, size); /* create string */ 169 *sl = ts = luaS_createlngstrobj(L, size); /* create string */
170 luaC_objbarrier(L, p, ts); 170 luaC_objbarrier(L, p, ts);
171 loadVector(S, getlngstr(ts), size); /* load directly in final place */ 171 loadVector(S, getlngstr(ts), size + 1); /* load directly in final place */
172 loadByte(S); /* skip ending '\0' */
173 } 172 }
174 S->nstr++; /* add string to list of saved strings */ 173 /* add string to list of saved strings */
174 S->nstr++;
175 setsvalue(L, &sv, ts); 175 setsvalue(L, &sv, ts);
176 luaH_setint(L, S->h, S->nstr, &sv); 176 luaH_setint(L, S->h, S->nstr, &sv);
177 luaC_objbarrierback(L, obj2gco(S->h), ts); 177 luaC_objbarrierback(L, obj2gco(S->h), ts);