From 3d81aa9c7a9fffcf6b6c33f80a9ea175ae6ff946 Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Mon, 15 Apr 2024 11:52:14 -0400 Subject: [PATCH] Use local positions for function calls in variable-tracking mode --- src/analyzer/expr/call/function_call_return_type_fetcher.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/analyzer/expr/call/function_call_return_type_fetcher.rs b/src/analyzer/expr/call/function_call_return_type_fetcher.rs index 78bd5b33..aba39812 100644 --- a/src/analyzer/expr/call/function_call_return_type_fetcher.rs +++ b/src/analyzer/expr/call/function_call_return_type_fetcher.rs @@ -770,7 +770,9 @@ fn add_dataflow( let function_call_node = DataFlowNode::get_for_method_return( functionlike_id, - if let Some(return_pos) = &functionlike_storage.return_type_location { + if data_flow_graph.kind == GraphKind::FunctionBody { + Some(statements_analyzer.get_hpos(pos)) + } else if let Some(return_pos) = &functionlike_storage.return_type_location { Some(*return_pos) } else { functionlike_storage.name_location