Skip to content

Commit

Permalink
Merge pull request #623 from pallene-lang/lua-5.4.7
Browse files Browse the repository at this point in the history
Update to Lua 5.4.7
  • Loading branch information
singul4ri7y authored Aug 12, 2024
2 parents 8c3f75b + 2ecc029 commit 9719c62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
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

0 comments on commit 9719c62

Please sign in to comment.