/// Insert calls to random location of ctx's calls.
Insert calls to random location of ctx's calls.
Insert calls to random location of ctx ' s calls .
pub fn insert_calls(ctx: &mut Context, _corpus: &CorpusWrapper, rng: &mut RngType) -> bool {
    if ctx.calls.len() > prog_len_range().end {
        return false;
    }
    let idx = rng.gen_range(0..=ctx.calls.len());
    restore_res_ctx(ctx, idx); // restore the resource information before call `idx`
    let sid = select_call_to(ctx, rng, idx);
    debug_info!(
        "insert_calls: inserting {} to location {}",
        ctx.target.syscall_of(sid).name(),
        idx
    );
    let mut calls_backup = std::mem::take(&mut ctx.calls);
    gen_one_call(ctx, rng, sid);
    let new_calls = std::mem::take(&mut ctx.calls);
    debug_info!("insert_calls: {} call(s) inserted", new_calls.len());
    calls_backup.splice(idx..idx, new_calls);
    ctx.calls = calls_backup;
    true
}
pub fn insert_calls ( ctx : & mut Context , _corpus : & CorpusWrapper , rng : & mut RngType ) -> bool { if ctx . calls . len ( ) > prog_len_range ( ) . end { return false ; } let idx = rng . gen_range ( 0 ..= ctx . calls . len ( ) ) ; restore_res_ctx ( ctx , idx ) ; // restore the resource information before call `idx` let sid = select_call_to ( ctx , rng , idx ) ; debug_info ! ( " " ctx target syscall_of ( sid ) name ( ) idx ) ; let mut calls_backup = std :: mem :: take ( & mut ctx . calls ) ; gen_one_call ( ctx , rng , sid ) ; let new_calls = std :: mem :: take ( & mut ctx . calls ) ; debug_info ! ( " " new_calls len ( ) ) ; calls_backup . splice ( idx .. idx , new_calls ) ; ctx . calls = calls_backup ; true }
Insert calls to random location of ctx's calls.
Insert calls to random location of ctx ' s calls .
ctx
&mut Context
_corpus
&CorpusWrapper
rng
&mut RngType