diff --git a/slither/core/source_mapping/source_mapping.py b/slither/core/source_mapping/source_mapping.py index d23f4b28a..e271db2c6 100644 --- a/slither/core/source_mapping/source_mapping.py +++ b/slither/core/source_mapping/source_mapping.py @@ -94,10 +94,10 @@ def _compute_line( Not done in an efficient way """ - start_line, starting_column = compilation_unit.core.crytic_compile.get_line_from_offset( + start_line, starting_column = compilation_unit.core.crytic_compile.get_line_and_character_from_offset( filename, start ) - end_line, ending_column = compilation_unit.core.crytic_compile.get_line_from_offset( + end_line, ending_column = compilation_unit.core.crytic_compile.get_line_and_character_from_offset( filename, start + length ) return list(range(start_line, end_line + 1)), starting_column, ending_column diff --git a/slither/utils/source_mapping.py b/slither/utils/source_mapping.py index 3e2beb764..62f1c3374 100644 --- a/slither/utils/source_mapping.py +++ b/slither/utils/source_mapping.py @@ -27,11 +27,11 @@ def get_definition(target: SourceMapping, crytic_compile: CryticCompile) -> Sour start_offset = txt.find(pattern) + 1 # remove the space - starting_line, starting_column = crytic_compile.get_line_from_offset( + starting_line, starting_column = crytic_compile.get_line_and_character_from_offset( target.source_mapping.filename, target.source_mapping.start + start_offset ) - ending_line, ending_column = crytic_compile.get_line_from_offset( + ending_line, ending_column = crytic_compile.get_line_and_character_from_offset( target.source_mapping.filename, target.source_mapping.start + start_offset + len(pattern) )