Skip to content

Commit 079b090

Browse files
author
yang.zhao2
committed
fix: free ic when parse func def failed and update mimalloc to v1.8.2 and add -fsanitize=address
1 parent b6b1997 commit 079b090

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "vendor/mimalloc"]
22
path = vendor/mimalloc
33
url = https://github.com/microsoft/mimalloc
4-
branch = v1.7.9
4+
branch = v1.8.2

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ add_subdirectory(vendor/mimalloc)
2121

2222
set(COMPILE_FLAGS -Wall -MMD -Wno-array-bounds -Wno-format-truncation)
2323
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
24-
set(COMPILE_FLAGS ${COMPILE_FLAGS} -g)
24+
set(MI_ASAN ON)
25+
set(COMPILE_FLAGS ${COMPILE_FLAGS} -g -fsanitize=address)
2526
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
2627
set(COMPILE_FLAGS ${COMPILE_FLAGS} -O3)
2728
endif()

src/core/parser.c

+4
Original file line numberDiff line numberDiff line change
@@ -7555,6 +7555,10 @@ static void js_free_function_def(JSContext *ctx, JSFunctionDef *fd)
75557555

75567556
free_bytecode_atoms(ctx->rt, fd->byte_code.buf, fd->byte_code.size,
75577557
fd->use_short_opcodes);
7558+
if (fd->ic) {
7559+
rebuild_ic(fd->ic);
7560+
free_ic(fd->ic);
7561+
}
75587562
dbuf_free(&fd->byte_code);
75597563
js_free(ctx, fd->jump_slots);
75607564
js_free(ctx, fd->label_slots);

0 commit comments

Comments
 (0)