[issue16060] Double decref and dereferencing after decref in int()

Mark Dickinson report at bugs.python.org
Thu Sep 27 17:33:54 CEST 2012


Mark Dickinson added the comment:

Nice catch!  And indeed, the following code generates a segfault on my machine:


    class B(object):
        def __int__(self):
            return 43.0

    class A(object):
        def __trunc__(self):
            return B()

    int(A())


The patch should probably include a regression test.

----------
nosy: +mark.dickinson
priority: normal -> high

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16060>
_______________________________________


More information about the Python-bugs-list mailing list