When enabling optimizations, my VM_END marker is not found

<< Click to Display Table of Contents >>

Navigation:  Code Virtualizer > FAQ > Macros >

When enabling optimizations, my VM_END marker is not found

This can be an issue with Tail Call Optimization.

 

To avoid the issue with the "missing END" marker due to Tail Call Optimization, please, just put an intrinsic __nop() after the END macro marker. You could also edit the definition of the END marker (or create your own wrapper for it) where you add at the end the "__nop();" instruction. Example:

 

 VM_START;

 

 MessageBoxW(0, L"Hello world!", 0, 0);

 

 VM_END;

 

 __nop();   // prevent TCO in this function