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..4328dea 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -16,6 +16,12 @@ #define __FILE_NAME__ __FILE__ #endif +#ifdef __GNUC__ +#define unused_attr __attribute__((unused)) +#else +#define unused_attr +#endif + #ifdef DEBUG_PRINT #define dbg_print(...) \ do { \ @@ -56,7 +62,7 @@ enum TokenType { TOKEN_TYPE_END, }; -void assert_valid_token(const TSSymbol sym) { +unused_attr static inline void assert_valid_token(const TSSymbol sym) { assertf(sym >= INDENT && sym < TOKEN_TYPE_END, "invalid symbol %d", sym); }