Skip to content

Commit

Permalink
Fix instrumentation error for virtual modifiers (#832)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgewecke authored Jan 26, 2024
1 parent 70de9d4 commit 658dc37
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,11 @@ parse.Modifiers = function(contract, modifiers) {
};

parse.ModifierDefinition = function(contract, expression) {
register.functionDeclaration(contract, expression);
parse[expression.body.type] &&
parse[expression.body.type](contract, expression.body);
if (expression.body) {
register.functionDeclaration(contract, expression);
parse[expression.body.type] &&
parse[expression.body.type](contract, expression.body);
}
};

parse.NewExpression = function(contract, expression) {
Expand Down
6 changes: 6 additions & 0 deletions test/integration/projects/solc-8/contracts/Abstract_solc8.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;

abstract contract ContractB {
modifier onlyOwner() virtual;
}

0 comments on commit 658dc37

Please sign in to comment.