From a8a399b809cc5cb08abda6d2881b518458687eca Mon Sep 17 00:00:00 2001 From: Josselin Date: Tue, 14 May 2019 14:23:55 +0100 Subject: [PATCH] Fix regex in source unit parsing (space bug) --- slither/solc_parsing/slitherSolc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slither/solc_parsing/slitherSolc.py b/slither/solc_parsing/slitherSolc.py index eebb99935..6d11e2cc8 100644 --- a/slither/solc_parsing/slitherSolc.py +++ b/slither/solc_parsing/slitherSolc.py @@ -136,7 +136,7 @@ class SlitherSolc(Slither): # match any char for filename # filename can contain space, /, -, .. - name = re.findall('=* (.+) =*', filename) + name = re.findall('=+ (.+) =+', filename) if name: assert len(name) == 1 name = name[0] @@ -154,7 +154,7 @@ class SlitherSolc(Slither): # This works only for crytic compile. # which used --combined-json ast, rather than --ast-json # 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) self._source_units[sourceUnit] = name