fn restore_partial_ctx(ctx: &mut Context, calls: &[Call]) {
    for call in calls {
        foreach_call_arg(call, |val| {
            if let Some(val) = val.as_vma() {
                let idx = val.addr / ctx.target().page_sz();
                let sz = val.vma_size / ctx.target().page_sz();
                ctx.vma_allocator.note_alloc(idx, sz);
            } else if let Some(val) = val.as_data() {
                if val.dir() != Dir::In || val.data.len() < 3 {
                    return;
                }
                let ty = val.ty(ctx.target);
                match ty.kind() {
                    TypeKind::BufferFilename => {
                        ctx.record_filename(&val.data);
                    }
                    TypeKind::BufferString => ctx.record_str(val.data.clone()),
                    _ => (),
                }
            } else if let Some(val) = val.as_res() {
                if let Some(id) = val.res_val_id() {
                    if ctx.next_res_id <= id {
                        ctx.next_res_id = id + 1;
                    }
                }
            }
        })
    }
}
/// Restore used vma, generated filenames, generated strs, next res id.  
Restore used vma, generated filenames, generated strs, next res id.
Restore used vma generated filenames generated strs next res id .
fn restore_partial_ctx(ctx: &mut Context, calls: &[Call]) {
    for call in calls {
        foreach_call_arg(call, |val| {
            if let Some(val) = val.as_vma() {
                let idx = val.addr / ctx.target().page_sz();
                let sz = val.vma_size / ctx.target().page_sz();
                ctx.vma_allocator.note_alloc(idx, sz);
            } else if let Some(val) = val.as_data() {
                if val.dir() != Dir::In || val.data.len() < 3 {
                    return;
                }
                let ty = val.ty(ctx.target);
                match ty.kind() {
                    TypeKind::BufferFilename => {
                        ctx.record_filename(&val.data);
                    }
                    TypeKind::BufferString => ctx.record_str(val.data.clone()),
                    _ => (),
                }
            } else if let Some(val) = val.as_res() {
                if let Some(id) = val.res_val_id() {
                    if ctx.next_res_id <= id {
                        ctx.next_res_id = id + 1;
                    }
                }
            }
        })
    }
}
fn restore_partial_ctx ( ctx : & mut Context , calls : & [ Call ] ) { for call in calls { foreach_call_arg ( call , | val | { if let Some ( val ) = val . as_vma ( ) { let idx = val . addr / ctx . target ( ) . page_sz ( ) ; let sz = val . vma_size / ctx . target ( ) . page_sz ( ) ; ctx . vma_allocator . note_alloc ( idx , sz ) ; } else if let Some ( val ) = val . as_data ( ) { if val . dir ( ) != Dir :: In || val . data . len ( ) < 3 { return ; } let ty = val . ty ( ctx . target ) ; match ty . kind ( ) { TypeKind :: BufferFilename => { ctx . record_filename ( & val . data ) ; } TypeKind :: BufferString => ctx . record_str ( val . data . clone ( ) ) , _ => ( ) , } } else if let Some ( val ) = val . as_res ( ) { if let Some ( id ) = val . res_val_id ( ) { if ctx . next_res_id <= id { ctx . next_res_id = id + 1 ; } } } } ) } }
Restore used vma, generated filenames, generated strs, next res id.
Restore used vma generated filenames generated strs next res id .
ctx
&mut Context
calls
&[Call]
ctx
&mut Context
calls
&[Call]