# New Ticket Created by Jerome Quelin
# Please include the string: [perl #18320]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=18320 >
And yet another bug discovered thanks to my Befunge interpreter (would you
please stop breaking my Befunge toy! :-) ). I can't see wether it's a
PerlArray, GC or string bug.
I managed to shorten it to:
$ cat foo.pasm
new P1, .PerlArray
set S0, " "
set S1, "123456789\nabcdefghijkl\nABCDEFGHIJKL"
substr S2, S1, 0, 9
concat S2, S0
set P1[0], S2
set P1[1], "foobar"
set S14, P1[0]
print ">>>"
print S14
print "<<<\n"
end
$ perl assemble.pl foo.pasm > foo.pbc
$ ./parrot foo.pbc
>>>123456789 �l <<<
This is of course not the correct result. The l near the end of the line is
machine-dependant, that is, it's garbage and can be whatever is in the memory.
Leon Brocard tried it and told me removing the foobar line still gets the bug
for him, but I need the foobar line on my machine to see the bug.
The first shortened piece of code had a repeat statement, but it does not
seem to be necessary for the bug. Anyway, here's the first shortened buggy
code:
new P1, .PerlArray
repeat S0, " ", 12
set S1, "123456789\nabcdefghijkl\nABCDEFGHIJKL"
substr S2, S1, 0, 9
concat S2, S0
substr S2, S2, 0, 80
set P1[0], S2
set P1[1], "foobar"
set S14, P1[0]
print ">>>"
print S14
print "<<<\n"
end
I can't shorten it anymore, and no, I don't have a patch. I don't even know
where the bug lies. I just know there's a bug :-)
Jerome
--
[EMAIL PROTECTED]