Am Mittwoch, 15. August 2007 20:05 schrieb Ron Blaschke:
> Visual C++ seems to optimize quite heavily, and it looks like it reuses
> the memory on the stack where arguments are passed for local variables.
> mov dword ptr [ebp+0Ch],edx
All I know about intel calling convs would summarize this as a nasty compiler
bug, not an optimization. This statement is clearly overwrting a stack frame
location, which doesn't belong to the called subroutine.
Maybe an explicit auto var of the interp would prevent this bug, something
like:
inline op returncc() {
Interp *i = interp; /* f*ck Visual C++ version ... */
PMC * const p = CONTEXT(i->ctx)->current_cont;
opcode_t * const dest = (opcode_t *)p->vtable->invoke(i,
p, expr NEXT());
goto ADDRESS(dest);
}
or some dummy statements #if def that compiler version or variations of above
idea.
Great analysis of the problem BTW,
thanks,
leo