diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-06-18 06:34:13 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-06-18 06:34:13 -0700 |
commit | 4891846939a05749fe24017aa33553828913a45e (patch) | |
tree | d48b45024e665fe7a151235602e984f36e6649b0 /mpi-patches/mpi-to-double | |
parent | 54a76c674e18e079b4a4f4338f41e44bfd5ed3e3 (diff) | |
download | txr-4891846939a05749fe24017aa33553828913a45e.tar.gz txr-4891846939a05749fe24017aa33553828913a45e.tar.bz2 txr-4891846939a05749fe24017aa33553828913a45e.zip |
vm: don't adjust ip in normal block return.
This issue does not come up in code generated by the
current compiler. A normal block return is always the
end instruction which immediately precedes the exit point.
Therefore the "vm->ip = exitpt" does nothing in that case;
it only changes vm->ip if the block is being abandoned
by a block return.
In the TCO work I'm doing, it's possible for a tail call
to occur in a block. Prior to the tail call's jump,
an end instruction will be executed to terminate
the block. That end instruction is inserted by the
compilation of the tail call. In this situation, the
"vm->ip = exitpt" is wrong; it diverts control to the
end of the block, skipping the jmp instruction.
* vm.c (vm_block): If we are terminating normally---i.e,
the vm_execute of the block returns---then adjust the
exitpt variable to the current ip. Then the subsequent
vm->ip = exitpt will do nothing; execution continues
after the end instruction that terminated the block.
Diffstat (limited to 'mpi-patches/mpi-to-double')
0 files changed, 0 insertions, 0 deletions