flash - C++ program compiled with FlasCC with -O4 (LTO) hangs on virtual call -


i have problem lto optimization in flascc.

when compiled -o1 resulting swf runs fine.

but -o4 first runs ok, hangs on specific virtual function call time on 15 seconds , flash stops it.

i've added printfs trace exact point of hang using flash logs.

it hangs @ printf( "program_step : vis init" ) never ever coming real initialize() implementation. pointer declared igamevisualizer *m_pvisualizer;

code:

   virtual void program_step( iprogramstep & step )     {         if ( !m_init )         {             if ( m_initcounter > 0 )             {                 printf( "\n program_step : later... %d skips left", m_initcounter );                 --m_initcounter;                 return;             }              printf( "\n program_step : init" );             m_init = true;             m_pvisualizer = create_slotsvisualizer_v1();             printf( "\n program_step : m_plogic" );             m_plogic = create_slotslogic_test();              if ( m_pvisualizer )             {                 printf( "\n program_step : vis init" );                 m_pvisualizer->initialize();             }              if ( m_plogic )             {                 printf( "\n program_step : logic init" );                 m_plogic->initialize( *this );             }              printf( "\n program_step : after inits" );         }          int dt = step.gettimedeltamsec();          processcontrols( dt );          if ( m_plogic )             m_plogic->process( dt, *this );          if ( m_pvisualizer )             m_pvisualizer->process( dt );     } 

okay, i've determined reasons:

1) printf() didn't show real place after fflush()

2) 1 of libraries compiled -o1, part of class code located in public inline method , compiled -o4 part of library => apparently 2 weren't compatible, caused infinite loop in parsing of binary stream...


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -