luaur_bytecode/methods/
bc_inst_helper_get_vm_const.rs1use crate::enums::bc_op_kind::BcOpKind;
2use crate::records::bc_function::VmConst;
3use crate::records::bc_inst_helper::BcInstHelper;
4use crate::records::bc_ref::BcRef;
5use luaur_common::macros::luau_assert::LUAU_ASSERT;
6
7impl BcInstHelper<'_> {
8 pub fn get_vm_const(&mut self, input_idx: u32) -> BcRef<'_, VmConst> {
9 let const_op = self.inst.operator_deref().ops[input_idx as usize];
10 LUAU_ASSERT!(const_op.kind == BcOpKind::VmConst);
11 self.graph.vm_const(const_op)
12 }
13}