mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 23:32:18 +00:00
[C++] Add ParseJson(), Parser(Parser&&), update fuzzers (#6284)
- add a new method ParseJson to minimize failures during fuzzing - add default (conditional) move-constructor for Parser - add a new monster_fuzzer - switch fuzzers to C++17 and `test/cpp17` generated code
This commit is contained in:
@@ -29,7 +29,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld")
|
||||
|
||||
add_compile_options(
|
||||
# -stdlib=libc++ # Use Clang libc++ instead of GNU.
|
||||
-std=c++14
|
||||
-std=c++17
|
||||
-Wall
|
||||
-pedantic
|
||||
-Werror
|
||||
@@ -52,7 +52,9 @@ add_library(fuzzer_config INTERFACE)
|
||||
target_compile_options(
|
||||
fuzzer_config
|
||||
INTERFACE
|
||||
#-fsanitize-coverage=edge,trace-cmp
|
||||
$<$<NOT:$<BOOL:${OSS_FUZZ}>>:
|
||||
-fsanitize-coverage=edge,trace-cmp
|
||||
>
|
||||
$<$<BOOL:${USE_ASAN}>:
|
||||
-fsanitize=fuzzer,undefined,address
|
||||
>
|
||||
@@ -131,6 +133,9 @@ target_link_libraries(parser_fuzzer PRIVATE flatbuffers_fuzzed)
|
||||
add_executable(verifier_fuzzer flatbuffers_verifier_fuzzer.cc)
|
||||
target_link_libraries(verifier_fuzzer PRIVATE flatbuffers_fuzzed)
|
||||
|
||||
add_executable(monster_fuzzer flatbuffers_monster_fuzzer.cc)
|
||||
target_link_libraries(monster_fuzzer PRIVATE flatbuffers_fuzzed)
|
||||
|
||||
# Build debugger for weird cases found with fuzzer.
|
||||
if(BUILD_DEBUGGER)
|
||||
add_library(flatbuffers_nonfuzz STATIC ${FlatBuffers_Library_SRCS})
|
||||
|
||||
Reference in New Issue
Block a user