This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Compilation regression with python-2.6 [Re: [PATCH 24/28] introduce gdb_pymodule_addobject]


>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> I notice that py_decref could actually be using Py_XDECREF instead
Pedro> of doing the explicit 'if (py)' check.

Pedro> -  /* Note that we need the extra braces in this 'if' to avoid a
Pedro> -     warning from gcc.  */
Pedro>    if (py)
Pedro> -    {
Pedro> -      Py_DECREF (py);
Pedro> -    }
Pedro> +    Py_DECREF (py);

The X is missing.

Also, as discussed on irc, if you do this you might as well zap
make_cleanup_py_xdecref and py_xdecref.

I think having one set of cleanup functions is plenty.  The NULL check
can't cost much, either in performance or clarity.

Really I would prefer to get rid of decref cleanups at all, since they
mess with the checker.  But this is a pain, and probably not worth the
effort unless we think we could really get to 0 false reports.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]