diff --git a/CMakeLists.txt b/CMakeLists.txt index a200eaec..0e3e0c75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/lj_parse.c b/src/lj_parse.c index 67d33ca8..894e4e56 100644 --- a/src/lj_parse.c +++ b/src/lj_parse.c @@ -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. */