From b983b6ff8ce8fe2168a77328e6801f0b86bb720b Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Sat, 2 Mar 2024 23:13:18 -0600 Subject: [PATCH] Re-enable ASAN for the fuzzer Fixes #131 Also touch the scanner to poke the fuzzer CI --- justfile | 3 +-- src/scanner.c | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index 92ff982..3d0aa64 100644 --- a/justfile +++ b/justfile @@ -18,8 +18,7 @@ just_sha := "a2ff42e6c37ba5c429d444f3a18d3633e59f9a34" # 1.24.0 include_args := "-Isrc/ -I" + ts_path + "/lib/include -Inode_modules/nan" general_cflags := "-Wall -Werror --pedantic -Wno-format-pedantic" -# FIXME: there are errors running with ASAN, we ideally want `,address` here -fuzzer_flags := env("FUZZER_FLAGS", "-fsanitize=fuzzer,undefined") +fuzzer_flags := env("FUZZER_FLAGS", "-fsanitize=fuzzer,address,undefined") fuzz_time := env("FUZZ_TOTAL_TIME", "1200") # Source files needed to build a parser diff --git a/src/scanner.c b/src/scanner.c index 848e601..d393de8 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -56,7 +56,8 @@ enum TokenType { TOKEN_TYPE_END, }; -void assert_valid_token(const TSSymbol sym) { +__attribute__((unused)) static inline void +assert_valid_token(const TSSymbol sym) { assertf(sym >= INDENT && sym < TOKEN_TYPE_END, "invalid symbol %d", sym); }