From 67f59319522e031a5d72112ab4dbd532efd55f0f Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 21 Jun 2008 20:45:32 +0000 Subject: [PATCH] Fix crashing in the Ruby reject method in the STL wrappers git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10543 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/ruby/rubycontainer.swg | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/ruby/rubycontainer.swg b/Lib/ruby/rubycontainer.swg index e3cae5778..919695ec2 100644 --- a/Lib/ruby/rubycontainer.swg +++ b/Lib/ruby/rubycontainer.swg @@ -691,10 +691,12 @@ namespace swig for ( ; i != e; ) { VALUE r = swig::from< Sequence::value_type >(*i); - if ( RTEST( rb_yield(r) ) ) + if ( RTEST( rb_yield(r) ) ) { $self->erase(i++); - else + e = self->end(); + } else { ++i; + } } return self;