On Feb 9, 2009, at 1:53 PM, Dag Sverre Seljebotn wrote: > Lisandro Dalcin wrote: >> Since Dag's refnanny was integrated in cython-devel, >> test/run/tryfinally.pyx was failing because of reference count >> errors. >> >> The patch below is the only way I can imagine to fix such problem. I >> expect the patch could be controversial... > > Me and Stefan should be OK with it at least: See #200 in trac. > (Whether > you initialize to Py_None or NULL is a finer point I suppose, I don't > have a feeling either way). > > To avoid the XDECREF in most situations one could make it depend on a > flag in ReturnStatNode and write a transform in Optimize.py which > turns > on the flag on all return nodes in functions which contain return > nodes > within finally clauses. But that could be done later if this fix is > pushed now.
I'm not sure this is the right fix, but it does appear to solve the (serious) issue so we should include it and can optimize later. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
