Fix the second issue with solc_args

pull/553/head
Maxime Biais 6 years ago
parent b51eee3605
commit 6fd8b76900
No known key found for this signature in database
GPG Key ID: F3EA910F71E3C894
  1. 11
      mythril/ether/util.py
  2. 4
      mythril/support/signatures.py

@ -18,10 +18,17 @@ def safe_decode(hex_encoded_string):
def get_solc_json(file, solc_binary="solc", solc_args=None):
cmd = [solc_binary, "--combined-json", "bin,bin-runtime,srcmap,srcmap-runtime", '--allow-paths', "."]
cmd = [solc_binary, "--combined-json", "bin,bin-runtime,srcmap,srcmap-runtime"]
if solc_args:
cmd.extend(solc_args.split(" "))
cmd.extend(solc_args.split())
if not "--allow-paths" in cmd:
cmd.extend(["--allow-paths", "."])
else:
for i, arg in enumerate(cmd):
if arg == "--allow-paths":
cmd[i + 1] += ",."
cmd.append(file)

@ -183,7 +183,7 @@ class SignatureDb(object):
:param file_path: solidity source code file path
:return: self
"""
self.signatures.update(SignatureDb.get_sigs_from_file(file_path, solc_binary, solc_args))
self.signatures.update(SignatureDb.get_sigs_from_file(file_path, solc_binary=solc_binary, solc_args=solc_args))
return self
@staticmethod
@ -214,7 +214,7 @@ class SignatureDb(object):
sigs = {}
cmd = [solc_binary, "--hashes", file_name]
if solc_args:
cmd.extend([i for i in solc_args.split(" ") if i != ""])
cmd.extend(solc_args.split())
try:
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate()

Loading…
Cancel
Save