Merge pull request #242 from crytic/dev-fix-regex-sourceunit

Fix regex in source unit parsing (space bug)
pull/244/head
Feist Josselin 6 years ago committed by GitHub
commit ede3765dba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      slither/solc_parsing/slitherSolc.py

@ -136,7 +136,7 @@ class SlitherSolc(Slither):
# match any char for filename # match any char for filename
# filename can contain space, /, -, .. # filename can contain space, /, -, ..
name = re.findall('=* (.+) =*', filename) name = re.findall('=+ (.+) =+', filename)
if name: if name:
assert len(name) == 1 assert len(name) == 1
name = name[0] name = name[0]
@ -154,7 +154,7 @@ class SlitherSolc(Slither):
# This works only for crytic compile. # This works only for crytic compile.
# which used --combined-json ast, rather than --ast-json # which used --combined-json ast, rather than --ast-json
# As a result -1 is not used as index # As a result -1 is not used as index
if not self.crytic_compile is None: if self.crytic_compile is not None:
sourceUnit = len(self.source_code) sourceUnit = len(self.source_code)
self._source_units[sourceUnit] = name self._source_units[sourceUnit] = name

Loading…
Cancel
Save