Forum

// tree optimize error!

To add comments, please log in or register

Loong
452
Loong 2010.02.06 11:30

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);
  }
Attached files
Applying One Indicator to Another
When writing an indicator that uses the short form of the OnCalculate() function call, you might miss the fact that an indicator can be calculated not only by price data, but also by data of some other indicator (no matter whether it is a built-in or custom one). Do you want to improve an indicator for its correct application to the other indicator's data? In this article we'll review all the steps required for such modification.
Loong
452
Loong 2010.02.06 11:46

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
2590
Rosh 2010.02.06 11:47
Thank you, we are fixing it on Monday.

Ilyas Sharapov
169
mql5 2010.02.08 11:49

Fixed. Please wait for updates.

/

To add comments, please log in or register