diff --git a/slither/core/source_mapping/source_mapping.py b/slither/core/source_mapping/source_mapping.py index 2a0ffa6a65..c4df7ff249 100644 --- a/slither/core/source_mapping/source_mapping.py +++ b/slither/core/source_mapping/source_mapping.py @@ -19,12 +19,12 @@ def _compute_line(source_code, start, length): Not done in an efficient way """ total_length = len(source_code) - source_code = source_code.split('\n') + source_code = source_code.splitlines(True) counter = 0 i = 0 lines = [] while counter < total_length: - counter += len(source_code[i]) +1 + counter += len(source_code[i]) i = i+1 if counter > start: lines.append(i)