blob: f44370b9a5971f63e7d8728bd88e464e4167c6b1 [file] [log] [blame]
Armin Rigob4b5a762006-01-14 10:58:30 +00001
2# http://python.org/sf/1303614
3
4class Strange(object):
5 def __hash__(self):
6 return hash('hello')
7
8 def __eq__(self, other):
9 x.__dict__ = {} # the old x.__dict__ is deallocated
10 return False
11
12
13class X(object):
14 pass
15
16if __name__ == '__main__':
17 v = 123
18 x = X()
19 x.__dict__ = {Strange(): 42,
20 'hello': v+456}
21 x.hello # segfault: the above dict is accessed after it's deallocated