This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jdemeyer
Recipients jdemeyer, vstinner
Date 2019-05-13.19:40:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
class IntWithDict:
    def __init__(self, **kwargs):
        self.kwargs = kwargs
    def __index__(self):
        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:04jdemeyersetrecipients: + jdemeyer, vstinner
2019-05-13 19:40:04jdemeyersetmessageid: <>
2019-05-13 19:40:03jdemeyerlinkissue36907 messages
2019-05-13 19:40:03jdemeyercreate