diff --git a/mythril/analysis/report.py b/mythril/analysis/report.py index 34c81db6..48bf7dbc 100644 --- a/mythril/analysis/report.py +++ b/mythril/analysis/report.py @@ -99,8 +99,10 @@ class Report: text += "### Description\n" + issue.description + "\n" - if issue.filename and issue.code: - text += "\nIn *" + issue.filename + ":*\n" + if issue.filename and issue.lineno: + text += "\nIn *%s:*\n%d" % (issue.filename, issue.lineno) + + if issue.code: text += "\n```\n" + issue.code + "\n```\n" return text diff --git a/mythril/ether/soliditycontract.py b/mythril/ether/soliditycontract.py index 9737e081..3e6bcf8d 100644 --- a/mythril/ether/soliditycontract.py +++ b/mythril/ether/soliditycontract.py @@ -56,6 +56,7 @@ class SolidityContract(ETHContract): self.name = name self.code = contract['bin-runtime'] self.creation_code = contract['bin'] + srcmap = contract['srcmap-runtime'].split(";") has_contract = True if not has_contract: @@ -63,10 +64,7 @@ class SolidityContract(ETHContract): self.mappings = [] - srcmap = contract['srcmap-runtime'].split(";") - for item in srcmap: - mapping = item.split(":") if len(mapping) > 0 and len(mapping[0]) > 0: