Skip to content

Commit

Permalink
Merge pull request #895 from eth-brownie/fix-yul-source-nodes
Browse files Browse the repository at this point in the history
Handle missing source nodes due to yul optimizations
  • Loading branch information
iamdefinitelyahuman authored Dec 24, 2020
2 parents cf976fe + b77da85 commit 4509902
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions brownie/project/compiler/solidity.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ def _generate_coverage_data(

# set contract path (-1 means none)
contract_id = str(source[2])
if contract_id not in source_nodes:
# In Solidity >=0.7.2 contract ID can reference an AST within the YUL-optimization
# "generatedSources". Brownie does not support coverage evaluation within these
# sources, so we consider to this to be unmapped.
continue

active_source_node = source_nodes[contract_id]
pc_list[-1]["path"] = contract_id

Expand Down

0 comments on commit 4509902

Please sign in to comment.