Skip to content

Commit

Permalink
Re-enable ASAN for the fuzzer
Browse files Browse the repository at this point in the history
Fixes #131

Also touch the scanner to poke the fuzzer CI
  • Loading branch information
tgross35 committed Mar 3, 2024
1 parent 4427d40 commit 7135eb3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 { \
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 7135eb3

Please sign in to comment.