aboutsummaryrefslogtreecommitdiff
path: root/lobject.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 /lobject.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 'lobject.c')
-rw-r--r--lobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lobject.c b/lobject.c
index 03e2798c..f73ffc6d 100644
--- a/lobject.c
+++ b/lobject.c
@@ -413,8 +413,8 @@ typedef struct BuffFS {
413*/ 413*/
414static void pushstr (BuffFS *buff, const char *str, size_t lstr) { 414static void pushstr (BuffFS *buff, const char *str, size_t lstr) {
415 lua_State *L = buff->L; 415 lua_State *L = buff->L;
416 setsvalue2s(L, L->top, luaS_newlstr(L, str, lstr)); 416 setsvalue2s(L, L->top.p, luaS_newlstr(L, str, lstr));
417 L->top++; /* may use one slot from EXTRA_STACK */ 417 L->top.p++; /* may use one slot from EXTRA_STACK */
418 if (!buff->pushed) /* no previous string on the stack? */ 418 if (!buff->pushed) /* no previous string on the stack? */
419 buff->pushed = 1; /* now there is one */ 419 buff->pushed = 1; /* now there is one */
420 else /* join previous string with new one */ 420 else /* join previous string with new one */
@@ -542,7 +542,7 @@ const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) {
542 addstr2buff(&buff, fmt, strlen(fmt)); /* rest of 'fmt' */ 542 addstr2buff(&buff, fmt, strlen(fmt)); /* rest of 'fmt' */
543 clearbuff(&buff); /* empty buffer into the stack */ 543 clearbuff(&buff); /* empty buffer into the stack */
544 lua_assert(buff.pushed == 1); 544 lua_assert(buff.pushed == 1);
545 return svalue(s2v(L->top - 1)); 545 return svalue(s2v(L->top.p - 1));
546} 546}
547 547
548 548