summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-11 23:19:22 +0800
committerruki <[email protected]>2022-05-11 23:19:22 +0800
commitb108db5be14666e83780b2f8cec4737666989e6f (patch)
tree4f4659909706367195c5405af2a76aa7de330dea
parent73094e9b1806d35d7b51423f8c805af228b7c721 (diff)
fix lua stack
-rw-r--r--core/src/xmake/semver/select.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/xmake/semver/select.c b/core/src/xmake/semver/select.c
index e820010b5..7d03968f6 100644
--- a/core/src/xmake/semver/select.c
+++ b/core/src/xmake/semver/select.c
@@ -52,6 +52,7 @@ static tb_bool_t xm_semver_select_from_versions_tags1(lua_State* lua, tb_int_t f
if (semver_range_pmatch(semver, range)) semvers_ppush(matches, *semver);
else semver_dtor(semver);
}
+ lua_pop(lua, 1);
}
// no matches?
@@ -88,6 +89,7 @@ static tb_bool_t xm_semver_select_from_versions_tags2(lua_State* lua, tb_int_t f
tb_char_t const* source_str = luaL_checkstring(lua, -1);
tb_size_t source_len = tb_strlen(source_str);
+ lua_pop(lua, 1);
if (source_len == version_len && tb_strncmp(source_str, version_str, version_len) == 0)
{
lua_createtable(lua, 0, 2);
@@ -111,6 +113,7 @@ static tb_bool_t xm_semver_select_from_branches(lua_State* lua, tb_int_t fromidx
tb_char_t const* source_str = luaL_checkstring(lua, -1);
tb_size_t source_len = tb_strlen(source_str);
+ lua_pop(lua, 1);
if (source_len == range_len && tb_memcmp(source_str, range_str, source_len) == 0)
{
lua_createtable(lua, 0, 2);
@@ -139,6 +142,8 @@ static tb_bool_t xm_semver_select_latest_from_versions_tags(lua_State* lua, tb_i
tb_char_t const* source_str = luaL_checkstring(lua, -1);
if (source_str && semver_tryn(semver, source_str, tb_strlen(source_str)) == 0)
semvers_ppush(matches, *semver);
+
+ lua_pop(lua, 1);
}
tb_check_return_val(matches->length, tb_false);