afl-fuzz.c
static void mark_bug_bb(void){
  MEM_BARRIER();
  *last_bb_ptr = 0;
  start_forkserver(&forksrv_pid_lh, &fsrv_ctl_fd_lh, &fsrv_st_fd_lh, FORKSRV_FD, use_crash_binary);
  run_target_2(&child_pid_lh, &fsrv_ctl_fd_lh, &fsrv_st_fd_lh, exec_tmout);
  /*  Change from bb to edge. Created by LH. */
  u32 last_edge = *last_bb_ptr;
  u32 last_bb = hash_end[last_edge];
  stop_forkserver(&forksrv_pid_lh, &fsrv_ctl_fd_lh, &fsrv_st_fd_lh);

  MEM_BARRIER();

  /* Modify bug_bb flag of adjacent basic block of last_bb */
  if(!bug_bb[last_bb]){
    bug_bb[last_bb] = true;
    for(u32 i_lh=0; i_lh<afl_map_size; i_lh++){
	    if(hash_head[i_lh] == last_bb){
		  bug_bb[hash_end[i_lh]] = true;
	    }
	    if(hash_end[i_lh] == last_bb){
		  bug_bb[hash_head[i_lh]] = true;
	    }
    }
  }

}
/* Mark the basic blocks with high incidence of bugs
    and update the bug_num of each test case,created by LH. */
Mark the basic blocks with high incidence of bugs
and update the bug_num of each test case,created by LH.
Mark the basic blocks with high incidence of bugs and update the bug_num of each test case created by LH .
static void mark_bug_bb(void){
  MEM_BARRIER();
  *last_bb_ptr = 0;
  start_forkserver(&forksrv_pid_lh, &fsrv_ctl_fd_lh, &fsrv_st_fd_lh, FORKSRV_FD, use_crash_binary);
  run_target_2(&child_pid_lh, &fsrv_ctl_fd_lh, &fsrv_st_fd_lh, exec_tmout);
  u32 last_edge = *last_bb_ptr;
  u32 last_bb = hash_end[last_edge];
  stop_forkserver(&forksrv_pid_lh, &fsrv_ctl_fd_lh, &fsrv_st_fd_lh);
  MEM_BARRIER();
  if(!bug_bb[last_bb]){
    bug_bb[last_bb] = true;
    for(u32 i_lh=0; i_lh<afl_map_size; i_lh++){
	    if(hash_head[i_lh] == last_bb){
		  bug_bb[hash_end[i_lh]] = true;
	    }
	    if(hash_end[i_lh] == last_bb){
		  bug_bb[hash_head[i_lh]] = true;
	    }
    }
  }
}
static void mark_bug_bb ( void ) { MEM_BARRIER ( ) ; * last_bb_ptr = 0 ; start_forkserver ( & forksrv_pid_lh , & fsrv_ctl_fd_lh , & fsrv_st_fd_lh , FORKSRV_FD , use_crash_binary ) ; run_target_2 ( & child_pid_lh , & fsrv_ctl_fd_lh , & fsrv_st_fd_lh , exec_tmout ) ; u32 last_edge = * last_bb_ptr ; u32 last_bb = hash_end [ last_edge ] ; stop_forkserver ( & forksrv_pid_lh , & fsrv_ctl_fd_lh , & fsrv_st_fd_lh ) ; MEM_BARRIER ( ) ; if ( ! bug_bb [ last_bb ] ) { bug_bb [ last_bb ] = true ; for ( u32 i_lh = 0 ; i_lh < afl_map_size ; i_lh ++ ) { if ( hash_head [ i_lh ] == last_bb ) { bug_bb [ hash_end [ i_lh ] ] = true ; } if ( hash_end [ i_lh ] == last_bb ) { bug_bb [ hash_head [ i_lh ] ] = true ; } } } }
Mark the basic blocks with high incidence of bugs
and update the bug_num of each test case,created by LH.
Mark the basic blocks with high incidence of bugs and update the bug_num of each test case created by LH .
/*  Change from bb to edge. Created by LH. */ /* Modify bug_bb flag of adjacent basic block of last_bb */