ó
o®¸Qc           @   st   d  Z  d d l Z d d d „  ƒ  YZ e ƒ  Z e ƒ  Z d e j e <e e _ e e _ e j ƒ  [ [ e j ƒ  d S(   sÓ  
The gc module can still invoke arbitrary Python code and crash.
This is an attack against _PyInstance_Lookup(), which is documented
as follows:

    The point of this routine is that it never calls arbitrary Python
    code, so is always "safe":  all it does is dict lookups.

But of course dict lookups can call arbitrary Python code.
The following code causes mutation of the object graph during
the call to has_finalizer() in gcmodule.c, and that might
segfault.
iÿÿÿÿNt   Ac           B   s   e  Z d  „  Z d „  Z RS(   c         C   s
   t  d ƒ S(   Nt   __del__(   t   hash(   t   self(    (    s4   /sys/lib/python2.7/test/crashers/gc_has_finalizer.pyt   __hash__   s    c         C   s
   |  `  t S(   N(   t   othert   False(   R   R   (    (    s4   /sys/lib/python2.7/test/crashers/gc_has_finalizer.pyt   __eq__   s    (   t   __name__t
   __module__R   R   (    (    (    s4   /sys/lib/python2.7/test/crashers/gc_has_finalizer.pyR       s   	(    (   t   __doc__t   gcR    t   at   bt   __dict__R   t   collect(    (    (    s4   /sys/lib/python2.7/test/crashers/gc_has_finalizer.pyt   <module>   s   				
