Skip to main content

luaur_bytecode/methods/
bytecode_graph_serializer_get_fallthrough.rs

1use crate::enums::bc_block_edge_kind::BcBlockEdgeKind;
2use crate::records::bc_block::BcBlock;
3use crate::records::bc_op::BcOp;
4use crate::records::bytecode_graph_serializer::BytecodeGraphSerializer;
5
6impl<'a> BytecodeGraphSerializer<'a> {
7    pub fn get_fallthrough(&self, block: &BcBlock) -> Option<BcOp> {
8        for edge in &block.successors {
9            if edge.kind == BcBlockEdgeKind::Fallthrough {
10                return Some(edge.target);
11            }
12        }
13        None
14    }
15}