Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Lua 5.4.7 #623

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .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.6-2
LUA_VERSION: 5.4.7
LUAROCKS_VERSION: 3.9.0

jobs:
Expand Down Expand Up @@ -81,7 +81,8 @@ jobs:
run: |
git clone https://github.com/pallene-lang/pallene-tracer
cd pallene-tracer
sudo make install LUA_DIR=/usr/local
make LUA_PREFIX=/usr/local
sudo make install

- name: Build
run: luarocks --local make
Expand All @@ -93,4 +94,3 @@ jobs:
run: |
eval "$(luarocks path)"
busted -o gtest -v ./spec

12 changes: 4 additions & 8 deletions src/pallene/coder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1317,14 +1317,10 @@ gen_cmd["SetTable"] = function(self, args)
return util.render([[
{
TValue keyv; ${init_keyv}
TValue valv; ${init_valv}
static int cache = -1;
TValue *slot = pallene_getstr($field_len, $tab, $key, &cache);
if (l_unlikely(isabstkey(slot))) {
TValue valv; ${init_valv}
luaH_newkey(L, $tab, &keyv, &valv);
} else {
${set_slot}
}
luaH_finishset(L, $tab, &keyv, slot, &valv);
${barrier};
}
]], {
Expand Down Expand Up @@ -1896,8 +1892,8 @@ function Coder:generate_luaopen_function()
int ${name}(lua_State *L)
{

#if LUA_VERSION_RELEASE_NUM != 50406
#error "Lua version must be exactly 5.4.6"
#if LUA_VERSION_RELEASE_NUM != 50407
#error "Lua version must be exactly 5.4.7"
#endif

luaL_checkcoreversion(L);
Expand Down
2 changes: 1 addition & 1 deletion src/pallene/pallenelib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ static TString *pallene_tostring(lua_State *L, const char* file, int line, TValu
return luaS_newlstr(L, buff, len);
}
case LUA_TSTRING:
return luaS_new(L, svalue(&v));
return luaS_new(L, getstr(tsvalue(&v)));
case LUA_TBOOLEAN:
return luaS_new(L, ((pallene_is_truthy(&v)) ? "true" : "false"));
default: {
Expand Down
Loading