diff --git a/src/analyzer/stmt/try_analyzer.rs b/src/analyzer/stmt/try_analyzer.rs index 5e518edd..01e788ae 100644 --- a/src/analyzer/stmt/try_analyzer.rs +++ b/src/analyzer/stmt/try_analyzer.rs @@ -191,6 +191,8 @@ pub(crate) fn analyze( false, ); + analysis_data.data_flow_graph.add_node(new_parent_node.clone()); + catch_type.parent_nodes.push(new_parent_node); catch_context diff --git a/src/code_info/data_flow/graph.rs b/src/code_info/data_flow/graph.rs index c891dac3..4177148a 100644 --- a/src/code_info/data_flow/graph.rs +++ b/src/code_info/data_flow/graph.rs @@ -182,7 +182,8 @@ impl DataFlowGraph { } } - if self.get_node(from_id).is_some() { + if self.vertices.contains_key(from_id) || self.sources.contains_key(from_id) + { if !visited_child_ids.contains(from_id) { new_parent_nodes.insert(from_id.clone()); } else {