From e8bd8e131baf6c98db389851c33fb367b99c838f Mon Sep 17 00:00:00 2001 From: Francesco Bertolaccini Date: Thu, 28 Mar 2024 16:45:53 +0100 Subject: [PATCH] Compute offset to contracts The alternative would be to make `Contract` inherit from `TopLevel`, but I'm not confident that wouldn't break other things --- slither/core/slither_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slither/core/slither_core.py b/slither/core/slither_core.py index 76220f5ba..4d4460f12 100644 --- a/slither/core/slither_core.py +++ b/slither/core/slither_core.py @@ -209,7 +209,7 @@ def _compute_offsets_from_thing(self, thing: SourceMapping): for offset in range(definition.start, definition.end + 1): if ( - isinstance(thing, TopLevel) + isinstance(thing, (TopLevel, Contract)) or ( isinstance(thing, FunctionContract) and thing.contract_declarer == thing.contract