luaur_bytecode/methods/bc_function_inst_op.rs
1use crate::enums::bc_op_kind::BcOpKind;
2use crate::records::bc_function::BcFunction;
3use crate::records::bc_inst::BcInst;
4use crate::records::bc_op::BcOp;
5use luaur_common::macros::luau_assert::LUAU_ASSERT;
6
7impl BcFunction {
8 pub fn inst_op(&mut self, op: BcOp) -> &mut BcInst {
9 LUAU_ASSERT!(op.kind == BcOpKind::Inst);
10 &mut self.instructions[op.index as usize]
11 }
12}