From caf15b12790febbecebbac4eecbadbe9d51db225 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Fri, 2 Dec 2016 15:56:23 +0100 Subject: [PATCH] fix infinite loop bug in regexp optimize --- alib2algo/src/regexp/simplify/RegExpOptimizeUnboundedPart.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alib2algo/src/regexp/simplify/RegExpOptimizeUnboundedPart.cxx b/alib2algo/src/regexp/simplify/RegExpOptimizeUnboundedPart.cxx index 5f5ae08ec5..56bdafdc76 100644 --- a/alib2algo/src/regexp/simplify/RegExpOptimizeUnboundedPart.cxx +++ b/alib2algo/src/regexp/simplify/RegExpOptimizeUnboundedPart.cxx @@ -884,7 +884,7 @@ bool RegExpOptimize::V10( UnboundedRegExpIteration < alphabet::Symbol > & node ) if( ! alt || ! any_of( alt->getChildren ( ).begin( ), alt->getChildren ( ).end( ), [] ( std::smart_ptr < UnboundedRegExpElement < alphabet::Symbol > > & a ) -> bool{ return dynamic_cast<UnboundedRegExpIteration < alphabet::Symbol > * >( a.get() ); } ) ) return false; - for( auto it = alt->getChildren ( ).begin( ); it != alt->getChildren ( ).end( ); ) { + for( auto it = alt->getChildren ( ).begin( ); it != alt->getChildren ( ).end( ); ++it ) { if ( dynamic_cast < UnboundedRegExpIteration < alphabet::Symbol > * > ( it->get ( ) ) ) alt->setChild ( std::move ( static_cast < UnboundedRegExpIteration < alphabet::Symbol > * >( it->get ( ) )->getChild ( ) ), it ); } -- GitLab