fix crash

This commit is contained in:
fesil 2024-07-18 20:44:23 +08:00
parent 5b750a81c3
commit 12fb2eea33
2 changed files with 7 additions and 2 deletions

View File

@ -76,11 +76,13 @@ if (LUAJIT_ENABLE_FSANITIZE)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "luajit debug mode")
add_definitions(-DLUA_USE_APICHECK -DLUA_USE_ASSERT -DLUAJIT_USE_SYSMALLOC)
if (MSVC)
if (NOT MSVC)
add_link_options(-fsanitize=address)
add_compile_options(-fsanitize=address)
else()
add_link_options(/fsanitize=address)
add_compile_options(/fsanitize=address)
endif()
endif()
endif()
CHECK_TYPE_SIZE("void*" SIZEOF_VOID_P)

View File

@ -1761,6 +1761,8 @@ static void expr_table(LexState *ls, ExpDesc *e)
lex_check(ls, '{');
#if LJ_DS_PARSER_TABLE_PATCH
GCtab* tmp_t = lj_tab_new(fs->L, 0, 0);
settabV(fs->L, fs->L->top, tmp_t);
incr_top(fs->L);
int tmp_indx = 0;
#endif
while (ls->tok != '}') {
@ -1871,6 +1873,7 @@ static void expr_table(LexState *ls, ExpDesc *e)
}
lj_gc_check(fs->L);
}
fs->L->top--;
}
/* Parse function parameters. */