aboutsummaryrefslogtreecommitdiff
path: root/lundump.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-10-29 12:06:37 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-10-29 12:06:37 -0300
commit413a393e6222482f46599e138bebac162610a572 (patch)
tree181517f8ec8d56f9101de33f4891729044f244de /lundump.c
parentba089bcb08a0efc6c26fb5c1e3c9d61c00cc012c (diff)
downloadlua-413a393e6222482f46599e138bebac162610a572.tar.gz
lua-413a393e6222482f46599e138bebac162610a572.tar.bz2
lua-413a393e6222482f46599e138bebac162610a572.zip
Stack indices changed to union's
That will allow to change pointers to offsets while reallocating the stack.
Diffstat (limited to 'lundump.c')
-rw-r--r--lundump.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lundump.c b/lundump.c
index 5aa55c44..aba93f82 100644
--- a/lundump.c
+++ b/lundump.c
@@ -120,10 +120,10 @@ static TString *loadStringN (LoadState *S, Proto *p) {
120 } 120 }
121 else { /* long string */ 121 else { /* long string */
122 ts = luaS_createlngstrobj(L, size); /* create string */ 122 ts = luaS_createlngstrobj(L, size); /* create string */
123 setsvalue2s(L, L->top, ts); /* anchor it ('loadVector' can GC) */ 123 setsvalue2s(L, L->top.p, ts); /* anchor it ('loadVector' can GC) */
124 luaD_inctop(L); 124 luaD_inctop(L);
125 loadVector(S, getstr(ts), size); /* load directly in final place */ 125 loadVector(S, getstr(ts), size); /* load directly in final place */
126 L->top--; /* pop string */ 126 L->top.p--; /* pop string */
127 } 127 }
128 luaC_objbarrier(L, p, ts); 128 luaC_objbarrier(L, p, ts);
129 return ts; 129 return ts;
@@ -321,7 +321,7 @@ LClosure *luaU_undump(lua_State *L, ZIO *Z, const char *name) {
321 S.Z = Z; 321 S.Z = Z;
322 checkHeader(&S); 322 checkHeader(&S);
323 cl = luaF_newLclosure(L, loadByte(&S)); 323 cl = luaF_newLclosure(L, loadByte(&S));
324 setclLvalue2s(L, L->top, cl); 324 setclLvalue2s(L, L->top.p, cl);
325 luaD_inctop(L); 325 luaD_inctop(L);
326 cl->p = luaF_newproto(L); 326 cl->p = luaF_newproto(L);
327 luaC_objbarrier(L, cl, cl->p); 327 luaC_objbarrier(L, cl, cl->p);