diff --git a/CMakeLists.txt b/CMakeLists.txt index fdfc784..69b9fad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,14 +133,14 @@ target_include_directories(tests PUBLIC src/) target_link_libraries(tests ccc ccc_platform ccc_versioninfo demanglegnu gtest) add_test(NAME tests COMMAND tests ${CMAKE_SOURCE_DIR}/testdata) -if(FUZZ) +if(ENABLE_FUZZ_TESTING) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_executable(fuzztest src/fuzztest.cpp) - target_compile_options(fuzztest PUBLIC -fsanitize=fuzzer) - target_link_options(fuzztest PUBLIC -fsanitize=fuzzer) + target_compile_options(fuzztest PUBLIC -fsanitize=fuzzer,address,signed-integer-overflow) + target_link_options(fuzztest PUBLIC -fsanitize=fuzzer,address,signed-integer-overflow) target_link_libraries(fuzztest ccc ccc_platform ccc_versioninfo demanglegnu) else() - message(FATAL_ERROR "The FUZZ option only supports clang.") + message(FATAL_ERROR "The ENABLE_FUZZ_TESTING option only supports clang.") endif() endif() diff --git a/src/fuzztest.cpp b/src/fuzztest.cpp index 386fab5..7fc93f3 100644 --- a/src/fuzztest.cpp +++ b/src/fuzztest.cpp @@ -26,11 +26,13 @@ extern "C" int LLVMFuzzerTestOneInput(const u8* data, size_t size) Result module_handle = import_symbol_tables( database, - (*symbol_file)->name(), *symbol_tables, + (*symbol_file)->name(), + Address(), NO_IMPORTER_FLAGS, demangler, nullptr); + static_cast(module_handle); return 0; }