[GD-Windows] very strange bug!!
Brought to you by:
vexxed72
From: Andras B. <bn...@ma...> - 2003-07-15 17:00:11
|
Hi, I've been fighting with this for a while, and now I think I have found the exact problem, but I'm not sure who's the bad guy... The problem is that when I call the Windows function acmDriverEnum, it clears the ESI register to zero. After this, the compiler's code tries to access memory through ESI, because he thinks it points to a valid address, resulting in an access violation!!! This is a very rare bug (it almost drove me crazy), because the compiler might use EAX, ECX, or any other register to hold the memory address, depending on the surrounding code. One workaround is to issue a line like this: __asm mov esi, esi after the call to acmDriverEnum, because this way the compiler will save and restore esi, or use another register... AFAIK it's the callee's responsibility to restore these registers. If this is true, then acmDriverEnum is broken. Should I report this somewhere? Bandi |