The value of ESP was not properly saved across a function call.

Hi

How do you debug one of these errors?


Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.


I'm using source code previously written in a new project without amendment. The source code worked fine in the previous project but now it's throwing this error.

In particular, the program throws the error on assigning the the clone to the pointer. ie. for
 
DataPtr = original.DataPtr->clone();

the pointer to the clone function of 'original' successfully clones the object 'original'. But then when it comes to assigning to the pointer 'DataPtr', the error is thrown.

Please let me know if there's any other information required.

Thanks and much appreciated

Edit: Just in case it helps, where DataPtr is successfully assigned the clone, the values held in memory are:
Before
DataPtr 0xcccccccc {Dimensionality=??? }
After
DataPtr 0x005159b0 {InnerGenerator={...} InitialSeed=1 Reciprocal=4.6566128752457969e-010 }

Whereas in the case of DataPtr not being assigned the clone
Before
DataPtr 0xcccccccc {Dimensionality=??? }
After
DataPtr 0xcccccccc {Dimensionality=??? }
Last edited on
Ok, it seems that this one is fixed by restarting the compiler (VC++ 2010 Express)
Topic archived. No new replies allowed.