Build 1241 Compiler crash, runtime crash

 

Hello,

compiler: 

i newly have problems with compiler of build 1241.

There is one expert which keeps the compiler crashing.

I could find the row which - when outcommented - removes the crash but i could not reproduce

this issues with simple code. 


runtime: 

Also, i have strange behaviour in windows 10 at runtime: A pointer cast to base class pointer fails which seems to be the case only on windows 10 machines.

So the pointer is invalid. In this case as well, i could not create simple code to demonstrate it.

 

example: 

 

classA* pA=(classA*) this;

 This worked so far on my MT5 installed in windows 7.

I works as well in debug mode in Windows 10 but in release note.

I already wrote the desk but i like to know, if i am the only one having these problems.

 

Thank you 

asdad 

 

I could reproduce the cast problem:

The expert attached, shows a message box about invalid pointer when you run it in windows 10 release (so no debug session).

Files:
ea_cast.mq5  1 kb
 
chinaski:

I could reproduce the cast problem:

The expert attached, shows a message box about invalid pointer when you run it in windows 10 release (so no debug session).

Confirmed. Is it reported to ServiceDesk ?
 
chinaski:

I could reproduce the cast problem:

The expert attached, shows a message box about invalid pointer when you run it in windows 10 release (so no debug session).

Interesting, I did not even know this could be implicitly converted to a pointer, in my code I used GetPointer(this) in assignments. But it was MT4.

 
I sent the sample to the service desk
 

Changing code from

(type*) this 

to

(type*) GetPointer(this)

 

solves it. Thank you for this hint. However, i never used GetPointer and my expert were fine. 

 
chinaski:

Changing code from

(type*) this 

to

(type*) GetPointer(this)

 

solves it. Thank you for this hint. However, i never used GetPointer and my expert were fine. 

There is additional unusual implicit behaviour - you may skip the casting operator (type*) in assignments, i.e. classA* pA= GetPointer(this);

Once they fix it I would get zillion errors. 

 

Hello,

thank you, the GetPointer solved all problems.

The invalid cast does not occur any longer as well as compiler crash disappeared.

 

I had this problems only on windows 10 in release version.

Thank you for help. 

Reason: