diff options
| author | Glenn Smith <glenn@vector35.com> | 2022-08-25 19:08:45 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2022-08-25 19:08:45 -0400 |
| commit | 67c7f90a4c701be78d03f66e4e6d3be8eb95236d (patch) | |
| tree | 30f27cb0e5e23ebac835c69e9293d93e99e89515 /python/lowlevelil.py | |
| parent | dc15526da1dfb13641146eb853828fa2d31c88b9 (diff) | |
Fix LowLevelILConstantBase __eq__ against unexpected types
Diffstat (limited to 'python/lowlevelil.py')
| -rw-r--r-- | python/lowlevelil.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 7733fdcc..c6ee2b4a 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -1073,21 +1073,33 @@ class LowLevelILConstantBase(LowLevelILInstruction, Constant): return self.constant != 0 def __eq__(self, other: 'LowLevelILConstantBase'): + if not isinstance(other, self.__class__): + return NotImplemented return self.constant == other.constant def __ne__(self, other: 'LowLevelILConstantBase'): + if not isinstance(other, self.__class__): + return NotImplemented return self.constant != other.constant def __lt__(self, other: 'LowLevelILConstantBase'): + if not isinstance(other, self.__class__): + return NotImplemented return self.constant < other.constant def __gt__(self, other: 'LowLevelILConstantBase'): + if not isinstance(other, self.__class__): + return NotImplemented return self.constant > other.constant def __le__(self, other: 'LowLevelILConstantBase'): + if not isinstance(other, self.__class__): + return NotImplemented return self.constant <= other.constant def __ge__(self, other: 'LowLevelILConstantBase'): + if not isinstance(other, self.__class__): + return NotImplemented return self.constant >= other.constant def __hash__(self): |
