I believe that stack alignment is broken for ia32 using 64 bit addresses for both the base compiler.
The offsetToFirstArg, offsetToLastArg and the offsetToJavaArg are not reset to their original values on the second iteration of the loop. This means that it will be pointing to the incorrect stack offset and hence it should be jumping into random code.
I propose a fix by remembering the first and the last arg offsets by:
The compiler, when aligning the stack, adds to the stack and hence shrinks the stack. This effectively corrupts the stack after it is done. This can be fixed by subtracting from the stack, effectively popping a placeholder value.
Also, I'm not too sure if this is intended or not, but when testing this code (in a 32bit environment), the subsequent code generated by the require_esp and the test in testBlock emitted:
This means that rather than testing the code against the stack pointer with the arguments pushed, you are testing it against the stack pointer without.
Operating System: Linux
Linux CECS4GJG4Y1 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 11:48:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux