Skip to content

Commit

Permalink
LMail: do not use main_L
Browse files Browse the repository at this point in the history
The fenv cache was allocated on the wrong lua_State.
  • Loading branch information
MaxKellermann committed Dec 4, 2023
1 parent adcc025 commit 76c6179
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cm4all-qrelay (0.26) unstable; urgency=low

* lua: remove deprecated method "mail:get_cgroup()"
* lua: close Lua file descriptors when connection is closed
* lua: fix broken cgroup xattr access

--

Expand Down
2 changes: 1 addition & 1 deletion src/Connection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ QmqpRelayConnection::OnRequest(AllocatedArray<std::byte> &&payload)

handler->Push(L);

NewLuaMail(L, GetMainState(), auto_close,
NewLuaMail(L, auto_close,
std::move(mail), peer_cred);

Resume(L, 1);
Expand Down
4 changes: 2 additions & 2 deletions src/LMail.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ RegisterLuaMail(lua_State *L)
}

MutableMail *
NewLuaMail(lua_State *L, lua_State *main_L,
NewLuaMail(lua_State *L,
Lua::AutoCloseList &auto_close,
MutableMail &&src, const struct ucred &peer_cred)
{
return LuaMail::New(L, main_L, auto_close, std::move(src), peer_cred);
return LuaMail::New(L, L, auto_close, std::move(src), peer_cred);
}

MutableMail &
Expand Down
4 changes: 1 addition & 3 deletions src/LMail.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ RegisterLuaMail(lua_State *L);

/**
* @param L the lua_State on whose stack the new object will be pushed
* @param main_L the lua_State which is used to destruct Lua values
* owned by the new object
*/
MutableMail *
NewLuaMail(lua_State *L, lua_State *main_L,
NewLuaMail(lua_State *L,
Lua::AutoCloseList &auto_close,
MutableMail &&src, const struct ucred &peer_cred);

Expand Down

0 comments on commit 76c6179

Please sign in to comment.