core/x86/encode.c
/* If has_instr_jmp_targets is true, this routine trashes the note field
 * of each instr_t to store the offset in order to properly encode
 * the relative pc for an instr_t jump target
 */
If has_instr_jmp_targets is true, this routine trashes the note field
of each instr_t to store the offset in order to properly encode
the relative pc for an instr_t jump target
If has_instr_jmp_targets is true this routine trashes the note field of each instr_t to store the offset in order to properly encode the relative pc for an instr_t jump target
byte *
instrlist_encode(dcontext_t *dcontext, instrlist_t *ilist, byte *pc,
                 bool has_instr_jmp_targets)
{
    instr_t *inst;
    int len = 0;
    if (has_instr_jmp_targets) {
        for (inst = instrlist_first(ilist); inst; inst = instr_get_next(inst)) {
            instr_set_note(inst, (void *)(ptr_int_t)len);
            len += instr_length(dcontext, inst);
        }
    }
    for (inst = instrlist_first(ilist); inst; inst = instr_get_next(inst)) {
        pc = instr_encode(dcontext, inst, pc);
        if (pc == NULL)
            return NULL;
    }
    return pc;
}
byte * instrlist_encode ( dcontext_t * dcontext , instrlist_t * ilist , byte * pc , bool has_instr_jmp_targets ) { instr_t * inst ; int len = 0 ; if ( has_instr_jmp_targets ) { for ( inst = instrlist_first ( ilist ) ; inst ; inst = instr_get_next ( inst ) ) { instr_set_note ( inst , ( void * ) ( ptr_int_t ) len ) ; len += instr_length ( dcontext , inst ) ; } } for ( inst = instrlist_first ( ilist ) ; inst ; inst = instr_get_next ( inst ) ) { pc = instr_encode ( dcontext , inst , pc ) ; if ( pc == NULL ) return NULL ; } return pc ; }
If has_instr_jmp_targets is true, this routine trashes the note field
 of each instr_t to store the offset in order to properly encode
 the relative pc for an instr_t jump target
If has_instr_jmp_targets is true this routine trashes the note field of each instr_t to store the offset in order to properly encode the relative pc for an instr_t jump target
/* must set note fields first with offset */