diff --git a/setup.py b/setup.py index 7e88b57a72..51a6a2e893 100644 --- a/setup.py +++ b/setup.py @@ -11,10 +11,12 @@ install_requires=[ "prettytable>=0.7.2", "pysha3>=1.0.2", - "crytic-compile>=0.2.0", - # "crytic-compile", + # "crytic-compile>=0.2.0", + "crytic-compile", + ], + dependency_links=[ + "git+https://github.com/crytic/crytic-compile.git@dev-line-and-char-to-offset#egg=crytic-compile" ], - # dependency_links=["git+https://github.com/crytic/crytic-compile.git@master#egg=crytic-compile"], license="AGPL-3.0", long_description=open("README.md").read(), entry_points={ diff --git a/slither/core/source_mapping/source_mapping.py b/slither/core/source_mapping/source_mapping.py index 9d18dd50cf..60d5ed358e 100644 --- a/slither/core/source_mapping/source_mapping.py +++ b/slither/core/source_mapping/source_mapping.py @@ -37,10 +37,14 @@ def _compute_line( Not done in an efficient way """ - start_line, starting_column = compilation_unit.core.crytic_compile.get_line_from_offset( - filename, start - ) - end_line, ending_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_and_character_from_offset( filename, start + length ) return list(range(start_line, end_line + 1)), starting_column, ending_column