[Cython] C++ STL iteration bugs

mark florisson markflorisson88 at gmail.com
Sun Aug 12 12:26:20 CEST 2012


On 12 August 2012 08:00, Robert Bradshaw <robertwb at gmail.com> wrote:
> On Sat, Aug 11, 2012 at 1:19 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:
>> Hi,
>>
>> I ran into a couple of problems with the new C++ STL integration, just
>> dumping them here for now.
>>
>> Invalid C code when using a stack allocated C++ vector inside of a
>> generator, also lacking type conversion utility code:
>>
>> https://github.com/cython/cython/commit/d0a8e24720c3ed4e723b5a1b204bf375780f51bd
>
> The problem here is that utility code attached at this stage of the
> pipeline gets ignored. In particular, we get to
> https://github.com/cython/cython/blob/a7c689c10eea66f9fe384d7bc324a7aa50975f9d/Cython/Compiler/UtilityCode.py#L130
> which I am at a loss to explain.

Heh, that should have had a comment :) Cython utility codes are
inserted at the AST level in ModuleNode (the merge_in method). This is
done since there is no actual C code at that point. I think it could
generate it and capture it as well, but it's probably more
complicated, and this works well with the name mangling schemes and
such.

> - Robert
> _______________________________________________
> cython-devel mailing list
> cython-devel at python.org
> http://mail.python.org/mailman/listinfo/cython-devel


More information about the cython-devel mailing list