I'm trying to compile a program which worked with the compiler of Visual C++ 6.0. Now, I'm compiling it using the compiler of Visual Studio 2010. It compiles but my program crashes on assignment of a variable:
sapHigh = ctx->saphigh;
In assembler code (using Visual Studio Debugger), this instruction is decomposed by:
00410DF3 mov eax,dword ptr [ctx]
00410DF6 mov ecx,dword ptr [eax+20h]
00410DF9 mov dword ptr [sapHigh],ecx
The instruction "mov eax, dword ptr[ctx]" return 0x00000000 in eax and the program crashes. But the debugger can see the real value of ctx pointer which is "0x0172287a". If I change the value of the eax register with its real value, "0x0172287a", the program still working fine until the next assignment.
Does anybody know why this instruction doesn't work ? Is this a problem with compilation options ?
Thank you for your help.
ctx
location? – eugene_che