Message342377
class IntWithDict:
def __init__(self, **kwargs):
self.kwargs = kwargs
def __index__(self):
self.kwargs.clear()
L = [2**i for i in range(10000)]
return 0
x = IntWithDict(dont_inherit=float())
compile("", "", "", x, **x.kwargs)
The above crashes CPython due to the usage of borrowed references in _PyStack_UnpackDict(): the dict x.kwargs contains the only reference to the float() object stored in x.kwargs
When parsing the arguments, x.__int__() is called, which clears the dict, removing the only reference to that float() |
|
Date |
User |
Action |
Args |
2019-05-13 19:40:04 | jdemeyer | set | recipients:
+ jdemeyer, vstinner |
2019-05-13 19:40:04 | jdemeyer | set | messageid: <1557776404.01.0.559706785576.issue36907@roundup.psfhosted.org> |
2019-05-13 19:40:03 | jdemeyer | link | issue36907 messages |
2019-05-13 19:40:03 | jdemeyer | create | |
|