summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author“pengxuanzheng” <[email protected]>2022-03-29 10:53:05 +0000
committer“pengxuanzheng” <[email protected]>2022-03-29 10:56:44 +0000
commit509d2023da9b8fa13ee4eb0774cb850771c416f7 (patch)
tree1da2f7508fbb49758aabc707207150be2676bdb8 /src
parent52b9316492ca0e3db4914fd4f2ea52669f7fd84f (diff)
🎈 perf: 适配rocky linux 8.5
Diffstat (limited to 'src')
-rw-r--r--src/tsg_lua_func.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tsg_lua_func.cpp b/src/tsg_lua_func.cpp
index f59fbbc..feecae6 100644
--- a/src/tsg_lua_func.cpp
+++ b/src/tsg_lua_func.cpp
@@ -184,6 +184,9 @@ static int tsg_lua_clfactory_bytecode_buffer_prepare(tsg_lua_clfactory_buffer_t
{
int little_endian, version, stripped;
+ if (ls == NULL)
+ return -1;
+
if (ls->file_type == TSG_LUA_BC_LJ)
{
/* get bytecode header */
@@ -725,6 +728,8 @@ int tsg_lua_exec(tsg_lua_handle lua, const char *script, size_t script_len, cons
tsg_lua_clfactory_buffer_t ls;
jmp_buf *lua_exception;
+ memset(&ls, 0, sizeof(tsg_lua_clfactory_buffer_t));
+
if (L == NULL)
{
debuginfo("lua VM is null.", __FILE__, __LINE__);