Skip to main content

encode_instructions

Function encode_instructions 

Source
pub fn encode_instructions(
    code: &mut DecodedCode,
    major_version: u16,
) -> Result<Vec<u8>, InstructionError>
Expand description

Encode a decoded instruction stream after recomputing offsets, switch padding, and branches.

Branch operands are resolved through code.offsets before layout. This preserves their stable instruction targets when callers insert, remove, or resize instructions. On success the locations and offset map in code describe the returned bytes.