Skip to content

Commit

Permalink
Merge pull request #578 from pallene-lang/lua-5.4.6
Browse files Browse the repository at this point in the history
Update to Lua 5.4.6
  • Loading branch information
hugomg committed May 20, 2023
2 parents d107376 + e62507d commit b4f6ba0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
branches: [ master ]

env:
LUA_VERSION: 5.4.4-2
LUA_VERSION: 5.4.6
LUAROCKS_VERSION: 3.9.0

jobs:
Expand Down
18 changes: 9 additions & 9 deletions src/pallene/coder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ end
function Coder:push_to_stack(typ, value)
return (util.render([[
${set_stack_slot}
L->top++;
L->top.p++;
]],{
set_stack_slot = set_stack_slot(typ, "s2v(L->top)", value),
set_stack_slot = set_stack_slot(typ, "s2v(L->top.p)", value),
}))
end

Expand Down Expand Up @@ -447,7 +447,7 @@ function Coder:pallene_entry_point_definition(f_id)
n = C.integer(slots_needed)
}))
end
table.insert(prologue, "StackValue *base = L->top;");
table.insert(prologue, "StackValue *base = L->top.p;");
table.insert(prologue, self:savestack())
table.insert(prologue, "/**/")

Expand Down Expand Up @@ -601,7 +601,7 @@ function Coder:lua_entry_point_definition(f_id)
return (util.render([[
${fun_decl}
{
StackValue *base = L->ci->func;
StackValue *base = L->ci->func.p;
${init_global_userdata}
/**/
${arity_check}
Expand Down Expand Up @@ -894,7 +894,7 @@ function Coder:update_stack_top(func, cmd)
local slot = self.gc[func].slot_of_variable[v_id]
offset = math.max(offset, slot + 1)
end
return util.render("L->top = base + $offset;", { offset = C.integer(offset) })
return util.render("L->top.p = base + $offset;", { offset = C.integer(offset) })
end

function Coder:savestack()
Expand Down Expand Up @@ -1417,8 +1417,8 @@ gen_cmd["CallDyn"] = function(self, cmd, func)
local get_slot = self:get_stack_slot(typ, dsts[i], "slot", cmd.loc, "return value #%d", i)
table.insert(pop_results, util.render([[
{
L->top--;
TValue *slot = s2v(L->top);
L->top.p--;
TValue *slot = s2v(L->top.p);
$get_slot
}
]], {
Expand Down Expand Up @@ -1815,8 +1815,8 @@ function Coder:generate_luaopen_function()
int ${name}(lua_State *L)
{
#if LUA_VERSION_RELEASE_NUM != 50404
#error "Lua version must be exactly 5.4.4"
#if LUA_VERSION_RELEASE_NUM != 50406
#error "Lua version must be exactly 5.4.6"
#endif
luaL_checkcoreversion(L);
Expand Down

0 comments on commit b4f6ba0

Please sign in to comment.