Skip to content

Commit 658dc37

Browse files
authored
Fix instrumentation error for virtual modifiers (#832)
1 parent 70de9d4 commit 658dc37

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lib/parse.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,11 @@ parse.Modifiers = function(contract, modifiers) {
217217
};
218218

219219
parse.ModifierDefinition = function(contract, expression) {
220-
register.functionDeclaration(contract, expression);
221-
parse[expression.body.type] &&
222-
parse[expression.body.type](contract, expression.body);
220+
if (expression.body) {
221+
register.functionDeclaration(contract, expression);
222+
parse[expression.body.type] &&
223+
parse[expression.body.type](contract, expression.body);
224+
}
223225
};
224226

225227
parse.NewExpression = function(contract, expression) {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.8.0 <0.9.0;
3+
4+
abstract contract ContractB {
5+
modifier onlyOwner() virtual;
6+
}

0 commit comments

Comments
 (0)