From: SourceForge.net <no...@so...> - 2012-03-13 07:09:40
|
Bugs item #3475492, was opened at 2012-01-18 04:54 Message generated for change (Comment added) made by wsfulton You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3475492&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: python Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: David Froger (dfroger) >Assigned to: William Fulton (wsfulton) Summary: segfault iterating on vector<enum> Initial Comment: Using swig 2.0.4, iterating on a vector<enum> produce a segmentation fault. ======================================= vec_enum.i ======================================= %module vec_enum %{ #define SWIG_FILE_WITH_INIT enum foobarbaz{foo,bar,baz}; %} %include "std_vector.i" enum foobarbaz{foo,bar,baz}; namespace std { %template(vector_foobarbaz) vector<foobarbaz>; } ======================================= main.py ======================================= import vec_enum vec = vec_enum.vector_foobarbaz() vec.append( vec_enum.foo ) vec.append( vec_enum.bar ) vec.append( vec_enum.baz ) # ok for ielt in range( len(vec) ): print vec[ielt] # segmentation fault for e in vec: print e ---------------------------------------------------------------------- >Comment By: William Fulton (wsfulton) Date: 2012-03-13 00:09 Message: Thanks for reporting. Now fixed for swig-2.0.5. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3475492&group_id=1645 |