Dan Sugalski wrote:
At 6:13 PM +0100 1/22/03, Leopold Toetsch wrote:
IMHO plain jumps do not work:
Sure they do. They work as well as jumps within code, which also has a
not-insignificant potential for problems.
But the issues you raised are some of the reasons I'd prefer
inter-segment jumping to be done via sub dispatch.
Ok then:
output_is(<<'CODE', <<'OUT', "intersegment branch");
# #!/usr/bin/perl -w
# my $i= 5;
# LAB:
# $i++;
# eval("goto LAB if ($i==6)");
# print "$i\n";
#
# 7
#####
.sub _test
I1 = 5
$S0 = ".sub _e\nif I1 == 6 goto LAB\nend\n.end\n"
compreg P2, "PIR"
compile P0, P2, $S0
LAB:
inc I1
invoke
print I1
print "\n"
end
.end
CODE
7
OUT