diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e3b8092..c2673b40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 @@ -93,4 +94,3 @@ jobs: run: | eval "$(luarocks path)" busted -o gtest -v ./spec - diff --git a/src/pallene/coder.lua b/src/pallene/coder.lua index 10bd6324..a2a41238 100644 --- a/src/pallene/coder.lua +++ b/src/pallene/coder.lua @@ -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}; } ]], { @@ -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); diff --git a/src/pallene/pallenelib.lua b/src/pallene/pallenelib.lua index 47be4517..4054b701 100644 --- a/src/pallene/pallenelib.lua +++ b/src/pallene/pallenelib.lua @@ -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: {