Commit 1e2119ad authored by Stefan Behnel's avatar Stefan Behnel

Prevent overflowing hash values for "Machines.Node" due to arbitrarily large...

Prevent overflowing hash values for "Machines.Node" due to arbitrarily large unsigned pointer values.
Closes https://github.com/cython/cython/issues/3840
parent 246a4b97
...@@ -121,7 +121,8 @@ class Node(object): ...@@ -121,7 +121,8 @@ class Node(object):
return self.number < other.number return self.number < other.number
def __hash__(self): def __hash__(self):
return id(self) # Prevent overflowing hash values due to arbitrarily large unsigned addresses.
return id(self) & maxint
class FastMachine(object): class FastMachine(object):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment