Download MetaTrader 5

tree optimize error!

To add comments, please log in or register
Loong
1269
Loong  

If you compile this code,
it will cause tree optimize error,
and crash MetaEditor (5.0.0.244)!

void TestMath6(long lParam)
{
   //if directly assign value to lLocal, will cause
   //tree optimize error                1       1
   //long   lLocal=lParam;
   long   lLocal=555;
   long   l_l_2;
   l_l_2 = (long)lLocal; //+lParam
}
int OnInit()
  {
   //TestMath6(777);
   return(0);
  }
Files:
Loong
1269
Loong  

Further testing

 

void TestMath6() //long lParam
{
   //if directly assign value to lLocal, will cause
   //tree optimize error                1       1
   //long   lLocal=lParam;
   long   lLocal=555;
   long   l_l_2;
   //lLocal=555; //move assignment to here, can not avoid crash
   l_l_2 = (long)lLocal; //+lParam (long)
   // and delete the typecasting can avoid crash
}
//remove OnInit(), can not avoid tree optimize error, but can avoid crash
int OnInit()
  {
   //TestMath6(777);
   return(0);
  }
Rashid Umarov
Admin
11993
Rashid Umarov  
Thank you, we are fixing it on Monday.

Ilyas
1208
Ilyas  

Fixed. Please wait for updates.

To add comments, please log in or register