Skip to main content

luaur_bytecode/methods/
bc_inst_helper_get_block.rs

1use crate::enums::bc_op_kind::BcOpKind;
2use crate::records::bc_block::BcBlock;
3use crate::records::bc_function::BcFunction;
4use crate::records::bc_inst_helper::BcInstHelper;
5use crate::records::bc_op::BcOp;
6use crate::records::bc_ref::BcRef;
7use luaur_common::macros::luau_assert::LUAU_ASSERT;
8
9impl BcInstHelper<'_> {
10    pub fn get_block(&mut self, input_idx: u32) -> BcRef<'_, BcBlock> {
11        let block_op = self.get_bc_op(input_idx);
12        LUAU_ASSERT!(block_op.kind == BcOpKind::Block);
13        self.graph.block(block_op)
14    }
15}