mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-12 10:08:07 +00:00
code-format
This commit is contained in:
@ -38,8 +38,8 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#if ! __GNUC__
|
#if !__GNUC__
|
||||||
#include "llvm/Config/llvm-config.h"
|
#include "llvm/Config/llvm-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
@ -117,12 +117,12 @@ void __afl_trace(const u32 x) {
|
|||||||
u8 *p = &__afl_area_ptr[prev ^ x];
|
u8 *p = &__afl_area_ptr[prev ^ x];
|
||||||
|
|
||||||
#if 1 /* enable for neverZero feature. */
|
#if 1 /* enable for neverZero feature. */
|
||||||
# if __GNUC__
|
#if __GNUC__
|
||||||
u8 c = __builtin_add_overflow (*p, 1, p);
|
u8 c = __builtin_add_overflow(*p, 1, p);
|
||||||
*p += c;
|
*p += c;
|
||||||
# else
|
#else
|
||||||
*p += 1 + ((u8)(1 + *p == 0);
|
*p += 1 + ((u8)(1 + *p == 0);
|
||||||
# endif
|
#endif
|
||||||
#else
|
#else
|
||||||
++*p;
|
++*p;
|
||||||
#endif
|
#endif
|
||||||
|
File diff suppressed because it is too large
Load Diff
105
src/afl-cc.c
105
src/afl-cc.c
@ -1282,65 +1282,72 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
" AFL_USE_MSAN: activate memory sanitizer\n"
|
" AFL_USE_MSAN: activate memory sanitizer\n"
|
||||||
" AFL_USE_UBSAN: activate undefined behaviour sanitizer\n");
|
" AFL_USE_UBSAN: activate undefined behaviour sanitizer\n");
|
||||||
|
|
||||||
if (have_gcc_plugin)
|
if (have_gcc_plugin)
|
||||||
SAYF(
|
SAYF(
|
||||||
"\nGCC Plugin-specific environment variables:\n"
|
"\nGCC Plugin-specific environment variables:\n"
|
||||||
" AFL_GCC_OUT_OF_LINE: disable inlined instrumentation\n"
|
" AFL_GCC_OUT_OF_LINE: disable inlined instrumentation\n"
|
||||||
" AFL_GCC_SKIP_NEVERZERO: do not skip zero on trace counters\n"
|
" AFL_GCC_SKIP_NEVERZERO: do not skip zero on trace counters\n"
|
||||||
" AFL_GCC_INSTRUMENT_FILE: enable selective instrumentation by filename\n");
|
" AFL_GCC_INSTRUMENT_FILE: enable selective instrumentation by "
|
||||||
|
"filename\n");
|
||||||
|
|
||||||
if (have_llvm)
|
if (have_llvm)
|
||||||
SAYF(
|
SAYF(
|
||||||
"\nLLVM/LTO/afl-clang-fast/afl-clang-lto specific environment "
|
"\nLLVM/LTO/afl-clang-fast/afl-clang-lto specific environment "
|
||||||
"variables:\n"
|
"variables:\n"
|
||||||
#if LLVM_MAJOR < 9
|
#if LLVM_MAJOR < 9
|
||||||
" AFL_LLVM_NOT_ZERO: use cycling trace counters that skip zero\n"
|
" AFL_LLVM_NOT_ZERO: use cycling trace counters that skip zero\n"
|
||||||
#else
|
#else
|
||||||
" AFL_LLVM_SKIP_NEVERZERO: do not skip zero on trace counters\n"
|
" AFL_LLVM_SKIP_NEVERZERO: do not skip zero on trace counters\n"
|
||||||
#endif
|
#endif
|
||||||
" AFL_LLVM_DICT2FILE: generate an afl dictionary based on found "
|
" AFL_LLVM_DICT2FILE: generate an afl dictionary based on found "
|
||||||
"comparisons\n"
|
"comparisons\n"
|
||||||
" AFL_LLVM_LAF_ALL: enables all LAF splits/transforms\n"
|
" AFL_LLVM_LAF_ALL: enables all LAF splits/transforms\n"
|
||||||
" AFL_LLVM_LAF_SPLIT_COMPARES: enable cascaded comparisons\n"
|
" AFL_LLVM_LAF_SPLIT_COMPARES: enable cascaded comparisons\n"
|
||||||
" AFL_LLVM_LAF_SPLIT_COMPARES_BITW: size limit (default 8)\n"
|
" AFL_LLVM_LAF_SPLIT_COMPARES_BITW: size limit (default 8)\n"
|
||||||
" AFL_LLVM_LAF_SPLIT_SWITCHES: cascaded comparisons on switches\n"
|
" AFL_LLVM_LAF_SPLIT_SWITCHES: cascaded comparisons on switches\n"
|
||||||
" AFL_LLVM_LAF_SPLIT_FLOATS: cascaded comparisons on floats\n"
|
" AFL_LLVM_LAF_SPLIT_FLOATS: cascaded comparisons on floats\n"
|
||||||
" AFL_LLVM_LAF_TRANSFORM_COMPARES: cascade comparisons for string "
|
" AFL_LLVM_LAF_TRANSFORM_COMPARES: cascade comparisons for string "
|
||||||
"functions\n"
|
"functions\n"
|
||||||
" AFL_LLVM_INSTRUMENT_ALLOW/AFL_LLVM_INSTRUMENT_DENY: enable "
|
" AFL_LLVM_INSTRUMENT_ALLOW/AFL_LLVM_INSTRUMENT_DENY: enable "
|
||||||
"instrument allow/\n"
|
"instrument allow/\n"
|
||||||
" deny listing (selective instrumentation)\n");
|
" deny listing (selective instrumentation)\n");
|
||||||
|
|
||||||
if (have_llvm)
|
if (have_llvm)
|
||||||
SAYF(
|
SAYF(
|
||||||
" AFL_LLVM_CMPLOG: log operands of comparisons (RedQueen mutator)\n"
|
" AFL_LLVM_CMPLOG: log operands of comparisons (RedQueen "
|
||||||
" AFL_LLVM_INSTRUMENT: set instrumentation mode:\n"
|
"mutator)\n"
|
||||||
" CLASSIC, INSTRIM, PCGUARD, LTO, CTX, NGRAM-2 ... NGRAM-16\n"
|
" AFL_LLVM_INSTRUMENT: set instrumentation mode:\n"
|
||||||
" You can also use the old environment variables instead:\n"
|
" CLASSIC, INSTRIM, PCGUARD, LTO, CTX, NGRAM-2 ... NGRAM-16\n"
|
||||||
" AFL_LLVM_USE_TRACE_PC: use LLVM trace-pc-guard instrumentation\n"
|
" You can also use the old environment variables instead:\n"
|
||||||
" AFL_LLVM_INSTRIM: use light weight instrumentation InsTrim\n"
|
" AFL_LLVM_USE_TRACE_PC: use LLVM trace-pc-guard instrumentation\n"
|
||||||
" AFL_LLVM_INSTRIM_LOOPHEAD: optimize loop tracing for speed "
|
" AFL_LLVM_INSTRIM: use light weight instrumentation InsTrim\n"
|
||||||
"(option to INSTRIM)\n"
|
" AFL_LLVM_INSTRIM_LOOPHEAD: optimize loop tracing for speed "
|
||||||
" AFL_LLVM_CTX: use context sensitive coverage (for CLASSIC and "
|
"(option to INSTRIM)\n"
|
||||||
"INSTRIM)\n"
|
" AFL_LLVM_CTX: use context sensitive coverage (for CLASSIC and "
|
||||||
" AFL_LLVM_NGRAM_SIZE: use ngram prev_loc count coverage (for "
|
"INSTRIM)\n"
|
||||||
"CLASSIC & INSTRIM)\n");
|
" AFL_LLVM_NGRAM_SIZE: use ngram prev_loc count coverage (for "
|
||||||
|
"CLASSIC & INSTRIM)\n");
|
||||||
|
|
||||||
#ifdef AFL_CLANG_FLTO
|
#ifdef AFL_CLANG_FLTO
|
||||||
if (have_lto)
|
if (have_lto)
|
||||||
SAYF(
|
SAYF(
|
||||||
"\nLTO/afl-clang-lto specific environment variables:\n"
|
"\nLTO/afl-clang-lto specific environment variables:\n"
|
||||||
" AFL_LLVM_MAP_ADDR: use a fixed coverage map address (speed), e.g. "
|
" AFL_LLVM_MAP_ADDR: use a fixed coverage map address (speed), "
|
||||||
"0x10000\n"
|
"e.g. "
|
||||||
" AFL_LLVM_DOCUMENT_IDS: write all edge IDs and the corresponding functions\n"
|
"0x10000\n"
|
||||||
" into this file\n"
|
" AFL_LLVM_DOCUMENT_IDS: write all edge IDs and the corresponding "
|
||||||
" AFL_LLVM_LTO_DONTWRITEID: don't write the highest ID used to a "
|
"functions\n"
|
||||||
"global var\n"
|
" into this file\n"
|
||||||
" AFL_LLVM_LTO_STARTID: from which ID to start counting from for a "
|
" AFL_LLVM_LTO_DONTWRITEID: don't write the highest ID used to a "
|
||||||
"bb\n"
|
"global var\n"
|
||||||
" AFL_REAL_LD: use this lld linker instead of the compiled in path\n"
|
" AFL_LLVM_LTO_STARTID: from which ID to start counting from for "
|
||||||
"If anything fails - be sure to read README.lto.md!\n");
|
"a "
|
||||||
|
"bb\n"
|
||||||
|
" AFL_REAL_LD: use this lld linker instead of the compiled in "
|
||||||
|
"path\n"
|
||||||
|
"If anything fails - be sure to read README.lto.md!\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SAYF(
|
SAYF(
|
||||||
|
@ -1043,11 +1043,11 @@ fsrv_run_result_t afl_fsrv_run_target(afl_forkserver_t *fsrv, u32 timeout,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fsrv->child_pid <= 0) {
|
if (fsrv->child_pid <= 0) {
|
||||||
|
|
||||||
if (*stop_soon_p) { return 0; }
|
if (*stop_soon_p) { return 0; }
|
||||||
FATAL("Fork server is misbehaving (OOM?)");
|
FATAL("Fork server is misbehaving (OOM?)");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exec_ms = read_s32_timed(fsrv->fsrv_st_fd, &fsrv->child_status, timeout,
|
exec_ms = read_s32_timed(fsrv->fsrv_st_fd, &fsrv->child_status, timeout,
|
||||||
|
Reference in New Issue
Block a user