fn analize(code: &[u8]) -> (ValidJumpAddress, usize) {
        let mut jumps: Vec<bool> = Vec::with_capacity(code.len());
        jumps.resize(code.len(), false);
        let mut is_push_last = false;
        let mut i = 0;
        while i < code.len() {
            let opcode = code[i] as u8;
            if opcode == opcode::JUMPDEST as u8 {
                is_push_last = false;
                jumps[i] = true;
                i += 1;
            } else if let Some(v) = OpCode::is_push(opcode) {
                is_push_last = true;
                i += v as usize + 1;
            } else {
                is_push_last = false;
                i += 1;
            }
        }
        let padding = if is_push_last { i - code.len() } else { 0 };

        (ValidJumpAddress(jumps), padding)
    }
/// Create a new valid mapping from given code bytes.
/// it gives back ValidJumpAddress and size od needed paddings.
Create a new valid mapping from given code bytes.
it gives back ValidJumpAddress and size od needed paddings.
Create a new valid mapping from given code bytes . it gives back ValidJumpAddress and size od needed paddings .
fn analize(code: &[u8]) -> (ValidJumpAddress, usize) {
        let mut jumps: Vec<bool> = Vec::with_capacity(code.len());
        jumps.resize(code.len(), false);
        let mut is_push_last = false;
        let mut i = 0;
        while i < code.len() {
            let opcode = code[i] as u8;
            if opcode == opcode::JUMPDEST as u8 {
                is_push_last = false;
                jumps[i] = true;
                i += 1;
            } else if let Some(v) = OpCode::is_push(opcode) {
                is_push_last = true;
                i += v as usize + 1;
            } else {
                is_push_last = false;
                i += 1;
            }
        }
        let padding = if is_push_last { i - code.len() } else { 0 };
        (ValidJumpAddress(jumps), padding)
    }
fn analize ( code : & [ u8 ] ) -> ( ValidJumpAddress , usize ) { let mut jumps : Vec < bool > = Vec :: with_capacity ( code . len ( ) ) ; jumps . resize ( code . len ( ) , false ) ; let mut is_push_last = false ; let mut i = 0 ; while i < code . len ( ) { let opcode = code [ i ] as u8 ; if opcode == opcode :: JUMPDEST as u8 { is_push_last = false ; jumps [ i ] = true ; i += 1 ; } else if let Some ( v ) = OpCode :: is_push ( opcode ) { is_push_last = true ; i += v as usize + 1 ; } else { is_push_last = false ; i += 1 ; } } let padding = if is_push_last { i - code . len ( ) } else { 0 } ; ( ValidJumpAddress ( jumps ) , padding ) }
Create a new valid mapping from given code bytes.
Create a new valid mapping from given code bytes .
code
&[u8]
code
&[u8]