Skip to content

Update Lua to 5.4.8#939

Merged
d0k3 merged 17 commits intod0k3:masterfrom
MisterSheeple:lua-5.4.8
Mar 25, 2026
Merged

Update Lua to 5.4.8#939
d0k3 merged 17 commits intod0k3:masterfrom
MisterSheeple:lua-5.4.8

Conversation

@MisterSheeple
Copy link
Copy Markdown
Contributor

@d0k3 d0k3 added the lua label Mar 18, 2026
@ihaveamac
Copy link
Copy Markdown
Contributor

Something in lcode.c was missed. (The other differences compared to 5.4.8 are indentation.)

Just to be sure, I copied 5.4.8's source to the repo and manually applied the patches in 9905b93 - these are the differences

diff --git a/arm9/source/lua/lcode.c b/arm9/source/lua/lcode.c
index 371ce59..3f78370 100644
--- a/arm9/source/lua/lcode.c
+++ b/arm9/source/lua/lcode.c
@@ -55,7 +55,7 @@ l_noret luaK_semerror (LexState *ls, const char *msg) {
 ** and returns 1. Otherwise, returns 0.
 */
 static int tonumeral (const expdesc *e, TValue *v) {
-  if (e->k == VJMP || hasjumps(e))
+  if (hasjumps(e))
     return 0;  /* not a numeral */
   switch (e->k) {
     case VKINT:
@@ -986,7 +986,7 @@ void luaK_exp2anyregup (FuncState *fs, expdesc *e) {
 ** or it is a constant.
 */
 void luaK_exp2val (FuncState *fs, expdesc *e) {
-  if (hasjumps(e))
+  if (e->k == VJMP || hasjumps(e))
     luaK_exp2anyreg(fs, e);
   else
     luaK_dischargevars(fs, e);
diff --git a/arm9/source/lua/ldo.c b/arm9/source/lua/ldo.c
index 55acd80..c92573d 100644
--- a/arm9/source/lua/ldo.c
+++ b/arm9/source/lua/ldo.c
@@ -116,7 +116,7 @@ l_noret luaD_throw (lua_State *L, int errcode) {
   else {  /* thread has no error handler */
     global_State *g = G(L);
     errcode = luaE_resetthread(L, errcode);  /* close all upvalues */
-	L->status = errcode;
+    L->status = errcode;
     if (g->mainthread->errorJmp) {  /* main thread has a handler? */
       setobjs2s(L, g->mainthread->top.p++, L->top.p - 1);  /* copy error obj. */
       luaD_throw(g->mainthread, errcode);  /* re-throw in main thread */
diff --git a/arm9/source/lua/lvm.c b/arm9/source/lua/lvm.c
index 5091e2d..7023a04 100644
--- a/arm9/source/lua/lvm.c
+++ b/arm9/source/lua/lvm.c
@@ -339,10 +339,10 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
       lua_assert(isempty(slot));  /* slot must be empty */
       tm = fasttm(L, h->metatable, TM_NEWINDEX);  /* get metamethod */
       if (tm == NULL) {  /* no metamethod? */
-		sethvalue2s(L, L->top.p, h);  /* anchor 't' */
+        sethvalue2s(L, L->top.p, h);  /* anchor 't' */
         L->top.p++;  /* assume EXTRA_STACK */
         luaH_finishset(L, h, key, slot, val);  /* set new value */
-		L->top.p--;
+        L->top.p--;
         invalidateTMcache(h);
         luaC_barrierback(L, obj2gco(h), val);
         return;

@MisterSheeple
Copy link
Copy Markdown
Contributor Author

Fixed, thanks! The indentation in those other files looks the same on my end though, and I'm not sure why.

@ihaveamac
Copy link
Copy Markdown
Contributor

Tabs vs spaces; GodMode9 expects spaces.

@MisterSheeple
Copy link
Copy Markdown
Contributor Author

Ah, thanks. should be fixed now.

@ihaveamac
Copy link
Copy Markdown
Contributor

Looks good to me now. One last thing is to update README.md in the lua folder to mention 5.4.8 and then it's ready.

@d0k3 d0k3 merged commit 1bbd819 into d0k3:master Mar 25, 2026
1 check passed
@d0k3
Copy link
Copy Markdown
Owner

d0k3 commented Mar 25, 2026

Thanks, both of you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants