ó
o®¸Qc           @   s   d  Z  d d l Z d d l Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d „  Z d e f d	 „  ƒ  YZ e j	 e ƒ  ƒ Z
 e
 j e ƒ  ƒ d S(
   sÖ  
General example for an attack against code like this:

    Py_DECREF(obj->attr); obj->attr = ...;

here in Module/_json.c:scanner_init().

Explanation: if the first Py_DECREF() calls either a __del__ or a
weakref callback, it will run while the 'obj' appears to have in
'obj->attr' still the old reference to the object, but not holding
the reference count any more.

Status: progress has been made replacing these cases, but there is an
infinite number of such cases.
iÿÿÿÿNt   Ctx1c           B   s2   e  Z d  Z d Z d Z d Z d Z d Z d Z	 RS(   t   utf8N(
   t   __name__t
   __module__t   encodingt   Nonet   strictt   object_hookt   object_pairs_hookt   parse_floatt	   parse_intt   parse_constant(    (    (    s<   /sys/lib/python2.7/test/crashers/decref_before_assignment.pyR       s   t   Fooc           B   s   e  Z RS(    (   R   R   (    (    (    s<   /sys/lib/python2.7/test/crashers/decref_before_assignment.pyR      s   c          G   s   t  j j GHd  S(   N(   t   scannerR   t   __dict__(   t   args(    (    s<   /sys/lib/python2.7/test/crashers/decref_before_assignment.pyt	   delete_me   s    t   Ctx2c           B   s   e  Z e d  „  ƒ Z RS(   c         C   s.   t  d ƒ } t ƒ  | _ t j | t ƒ a | S(   NR   (   R   t   globalst   abct   weakreft   refR   t   wref(   t   selft   f(    (    s<   /sys/lib/python2.7/test/crashers/decref_before_assignment.pyR   #   s    (   R   R   t   propertyR   (    (    (    s<   /sys/lib/python2.7/test/crashers/decref_before_assignment.pyR   "   s   (   t   __doc__t   _jsonR   t   objectR    t   unicodeR   R   R   t   make_scannerR   t   __init__(    (    (    s<   /sys/lib/python2.7/test/crashers/decref_before_assignment.pyt   <module>   s   			