From 89f9cb476aa02276a196e9a79ac675f7d15f9d3d Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Thu, 25 Apr 2019 14:29:38 -0400 Subject: add type checks for various comparators --- python/mediumlevelil.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python/mediumlevelil.py') diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index e8d58f96..b6b7dbfc 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -43,6 +43,8 @@ class SSAVariable(object): return "" % (repr(self.var), self.version) def __eq__(self, other): + if not isinstance(other, type(self)): + return False return isinstance(other, SSAVariable) and ( (self.var, self.version) == (other.var, other.version) @@ -318,6 +320,8 @@ class MediumLevelILInstruction(object): return "" % str(self) def __eq__(self, value): + if not isinstance(value, type(self)): + return False return self.function == value.function and self.expr_index == value.expr_index @property -- cgit v1.3.1