[MERGE] Handle references to line data in _patiencediff_c.c properly

Lukáš Lalinský lalinsky at gmail.com
Sun Aug 17 20:41:15 BST 2008


And as usually, when I do something too fast, I do it wrong... Here is
the correct patch.

Lukas

Dňa Ne, 2008-08-17 o 21:34 +0200, Lukáš Lalinský napísal:
> This code is called in bzrlib only with lists or tuples of strings,
> which works fine, because PySequence_Fast always returns the same object
> and so the items from PySequence_Fast_GET_ITEM will not be deleted until
> the original sequence is deleted. But if it's called with a sequence
> than needs to be converted to list (e.g. PyUnicode), the items will be
> garbage collected in the contructor and still used later in code (which
> leads to segfaults).
> 
> I really don't how to write a failing test for something like this, so
> there are no tests in the patch. :(

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patiencediff-refs.diff
Type: text/x-patch
Size: 5250 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080817/5f2007e4/attachment-0001.bin 


More information about the bazaar mailing list