Line number problem with machine code and PIKE_FRAME_RETURN_INTERNAL
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=3060
Reported by Martin Stjernholm mast@roxen.com
void x (mixed val) { }
class X
{
void create() {error ("foo\n");}
}
object rx = class {}(); // Line 10
int main()
{
x (rx->x);
rx = X(); // Line 15
}
When using machine code (at least on ia32), the backtrace generated in the program above says the line for the X call in main() is 10, which is clearly wrong.
The reason for the bogus line numbers is that the opcodes in interpret_functions.h that use PIKE_FRAME_RETURN_INTERNAL change Pike_fp->pc. That doesn't work well together with machine code that increments it relatively.
Afaics it's either necessary to add FLUSH_CODE_GENERATOR_STATE after those opcodes, or use another place than Pike_fp->pc to store the return address.
A testsuite test has been added.