aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2023-03-19 20:39:33 +0000
committerthe lemons <citrons@mondecitronne.com>2023-03-20 22:24:28 -0500
commit9ce7a7ed9818208791041a29e6653e16b81d8604 (patch)
treefefcb2c706cc869d81f4c9de2fc3b387c40057f6
parentf6a88e1ee6d62dc447a8d8b1d77d63f1ab9b5ade (diff)
fix stack underflow causing segfault on luajit
-rw-r--r--lmdb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lmdb.c b/lmdb.c
index 41bb2cf..f81d555 100644
--- a/lmdb.c
+++ b/lmdb.c
@@ -391,8 +391,9 @@ static void mt(lua_State *L, const char *name, const struct luaL_Reg l[]) {
if (lua_isnil(L, -1)){
lua_pop(L, 1);
lua_setfield(L, -1, "__index");
+ } else {
+ lua_pop(L, 2);
}
- lua_pop(L, 2);
}
static void parentmap(lua_State *L) {