prog_leavefunction needs to take the ++st into account - otherwise INSTR_RETURN ends up skipping the instruction after the calling INSTR_CALL

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-16 16:28:59 +02:00
parent 54dcbc22bf
commit 9f951e36a9

2
exec.c
View file

@ -512,7 +512,7 @@ static qcint prog_leavefunction(qc_program *prog)
exit(1);
}
return st.stmt;
return st.stmt - 1; /* offset the ++st */
}
bool prog_exec(qc_program *prog, prog_section_function *func, size_t flags, long maxjumps)