diff options
| author | Josh Watson <josh@trailofbits.com> | 2018-11-06 10:53:08 -0800 |
|---|---|---|
| committer | Jordan <jordan@psifertex.com> | 2018-11-06 15:21:45 -0500 |
| commit | 37694b9a1a95a8f876f09f21bceacbfd7abc6716 (patch) | |
| tree | a6f133a81f22b55ea65b319b201188cb47737c25 /python | |
| parent | bdda26803d3a140abf0aad30b5a26584c605a067 (diff) | |
Add type check to `Variable.__eq__`
`Variable.__eq__` fails to check if the other value is actually a Variable object before comparing member properties. This fixes the exception that gets raised when comparing a Variable against something else.
Diffstat (limited to 'python')
| -rw-r--r-- | python/function.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/python/function.py b/python/function.py index 3f908ef6..dce57975 100644 --- a/python/function.py +++ b/python/function.py @@ -293,6 +293,8 @@ class Variable(object): return self.name def __eq__(self, other): + if not isinstance(other, Variable): + return False return (self.identifier, self.function) == (other.identifier, other.function) def __hash__(self): |
