rdi_format_parse: prefer line info idxs with file coordinates in line mapping helper

This commit is contained in:
Ryan Fleury
2024-06-19 13:27:34 -07:00
parent b5b5aca691
commit 6eef8c3e16
+8
View File
@@ -302,6 +302,14 @@ rdi_line_info_idx_from_voff(RDI_ParsedLineTable *line_info, RDI_U64 voff)
{
RDI_U64 count = 0;
RDI_U64 result = rdi_line_info_idx_range_from_voff(line_info, voff, &count);
for(RDI_U64 idx = 0; idx < count && result+idx < line_info->count; idx += 1)
{
if(line_info->lines[result+idx].file_idx != 0)
{
result += idx;
break;
}
}
return result;
}