From 1cbdd0f33a1cfe3ed1b7050e9951e72fdbc886e4 Mon Sep 17 00:00:00 2001 From: rajeevgopalakrishna Date: Tue, 14 May 2019 12:22:46 +0530 Subject: [PATCH] Changes parameters_src and returns_src to SourceMapping objects instead of raw source text. --- slither/solc_parsing/declarations/function.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/slither/solc_parsing/declarations/function.py b/slither/solc_parsing/declarations/function.py index 0e020b1da..7619dea08 100644 --- a/slither/solc_parsing/declarations/function.py +++ b/slither/solc_parsing/declarations/function.py @@ -27,6 +27,7 @@ from slither.utils.utils import unroll from slither.visitors.expression.export_values import ExportValues from slither.visitors.expression.has_conditional import HasConditional from slither.solc_parsing.exceptions import ParsingError +from slither.core.source_mapping.source_mapping import SourceMapping logger = logging.getLogger("FunctionSolc") @@ -835,7 +836,8 @@ class FunctionSolc(Function): def _parse_params(self, params): assert params[self.get_key()] == 'ParameterList' - self.parameters_src = params['src'] + self.parameters_src = SourceMapping() + self.parameters_src.set_offset(params['src'], self.contract.slither) if self.is_compact_ast: params = params['parameters'] @@ -862,7 +864,8 @@ class FunctionSolc(Function): assert returns[self.get_key()] == 'ParameterList' - self.returns_src = returns['src'] + self.returns_src = SourceMapping() + self.returns_src.set_offset(returns['src'], self.contract.slither) if self.is_compact_ast: returns = returns['parameters']