Skip to main content

luaur_bytecode/methods/
bc_inst_helper_get_bc_op.rs

1use crate::records::bc_inst_helper::BcInstHelper;
2use crate::records::bc_op::BcOp;
3
4impl BcInstHelper<'_> {
5    pub fn get_bc_op(&mut self, input_idx: u32) -> BcOp {
6        let inst = self.operator_deref();
7        if (input_idx as usize) >= inst.ops.len() {
8            let inst_mut = unsafe {
9                &mut *(self.inst.operator_arrow() as *mut crate::records::bc_inst::BcInst)
10            };
11            inst_mut.ops.resize((input_idx + 1) as u32);
12        }
13        self.operator_deref().ops[input_idx as usize]
14    }
15}