Skip to main content

luaur_bytecode/methods/
bytecode_graph_serializer_get_imm_import.rs

1use crate::enums::bc_imm_kind::BcImmKind;
2use crate::records::bc_inst::BcInst;
3use crate::records::bytecode_graph_serializer::BytecodeGraphSerializer;
4use luaur_common::macros::luau_assert::LUAU_ASSERT;
5
6impl<'a> BytecodeGraphSerializer<'a> {
7    pub fn get_imm_import(&mut self, insn: &mut BcInst, index: u8) -> u32 {
8        let imm = self.get_imm(insn, index);
9        LUAU_ASSERT!(imm.kind == BcImmKind::Import);
10        unsafe { imm.value.valueImport }
11    }
12}