Skip to main content

luaur_bytecode/methods/
bytecode_graph_parser_add_vm_const_input.rs

1use crate::enums::bc_op_kind::BcOpKind;
2use crate::records::bc_inst::BcInst;
3use crate::records::bc_op::BcOp;
4use crate::records::bytecode_graph_parser::BytecodeGraphParser;
5use luaur_common::macros::luau_assert::LUAU_ASSERT;
6
7impl<'a> BytecodeGraphParser<'a> {
8    pub fn add_vm_const_input(&mut self, inst: *mut BcInst, idx: u32) {
9        let inst = unsafe { &mut *inst };
10        LUAU_ASSERT!(idx < self.func.constants.len() as u32);
11        inst.ops
12            .push_back(BcOp::bc_op_bc_op_kind_u32(BcOpKind::VmConst, idx));
13    }
14}