From 2ab766734d906f5e5a003c0e2b9595d48fb711e2 Mon Sep 17 00:00:00 2001 From: webthethird Date: Wed, 28 Dec 2022 14:04:51 -0600 Subject: [PATCH] Also compare the number of struct elements --- slither/core/declarations/structure.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/slither/core/declarations/structure.py b/slither/core/declarations/structure.py index 3fe7db7e6..b94ed4f50 100644 --- a/slither/core/declarations/structure.py +++ b/slither/core/declarations/structure.py @@ -55,6 +55,8 @@ class Structure(SourceMapping): def __eq__(self, other) -> bool: if not isinstance(other, Structure): return False + if len(self.elems) != len(other.elems): + return False for idx, elem in enumerate(self.elems_ordered): other_elem = other.elems_ordered[idx] if str(other_elem.type) != str(elem.type) or other_elem.name != elem.name: