afl-cc lto fix
MODIFY
src/afl-cc.c
src/afl-cc.c
@@ -556,7 +556,16 @@ static void edit_params(u32 argc, char **argv, char **envp) {
if (lto_mode && !have_c) {
u8 *ld_path = NULL;
- if (getenv("AFL_REAL_LD")) { ld_path = strdup(getenv("AFL_REAL_LD")); }
+ if (getenv("AFL_REAL_LD")) {
+
+ ld_path = strdup(getenv("AFL_REAL_LD"));
+
+ } else {
+
+ ld_path = strdup(AFL_REAL_LD);
+
+ }
+
if (!ld_path || !*ld_path) { ld_path = strdup("ld.lld"); }
if (!ld_path) { PFATAL("Could not allocate mem for ld_path"); }
#if defined(AFL_CLANG_LDPATH) && LLVM_MAJOR >= 12

MODIFY
src/afl-forkserver.c
src/afl-forkserver.c
@@ -422,7 +422,6 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
fsrv->map_size =
fsrv->nyx_handlers->nyx_get_bitmap_buffer_size(fsrv->nyx_runner);
- ;
fsrv->real_map_size = fsrv->map_size;
fsrv->trace_bits =
@@ -1192,7 +1191,7 @@ u32 afl_fsrv_get_mapsize(afl_forkserver_t *fsrv, char **argv,
void afl_fsrv_write_to_testcase(afl_forkserver_t *fsrv, u8 *buf, size_t len) {
#ifdef __linux__
- if (fsrv->nyx_mode) {
+ if (unlikely(fsrv->nyx_mode)) {
fsrv->nyx_handlers->nyx_set_afl_input(fsrv->nyx_runner, buf, len);
return;
@@ -1200,6 +1199,7 @@ void afl_fsrv_write_to_testcase(afl_forkserver_t *fsrv, u8 *buf, size_t len) {
}
#endif
+
#ifdef AFL_PERSISTENT_RECORD
if (unlikely(fsrv->persistent_record)) {

afl-cc lto fix