Hi all,
Seems like it that bug 18702 has nothing to do with my changes to the stack-balancing code, and that nested function proc's never functioned well on Windows.
The problem is that pop_parasize() is used to pop the stack-frame pointer form the stack. But on 32-bit Windows, pop_parasize() has some code to ensure that the funcret pointer is removed from the stack by the caller. This is not applicable to the situation where only the stack-frame pointer has to be popped from the stack.
A possible solution is attached, but I didn't commit it yet because I'm nut sure if it is 'allowed' to use a 'target_info.system = system_i386_win32' condition in ncgcal.pas. Other solutions could be to add a parameter to pop_parasize or to add something like pop_funcret_parasize().
Thoughts?
Joost.
