Some updates as of r28833, (kubuntu 8.04, x86)
Simple ranges seem to work:
$ ./parrot perl6.pbc -e '1..1000' # works
$ ./parrot perl6.pbc -e 'say 1..1000' # works
The original test case segfaults after 214 iterations:
$ cat x
for 1..1000 -> $a { say $a }
$ ./parrot perl6.pbc x
1
2
3
[...4 through 211...]
212
213
214
Segmentation fault
But it works with the -G flag:
$ ./parrot -G perl6.pbc x
1
2
3
[...4 through 997...]
998
999
1000
If we read the program via the -e flag, it segfaults after 174 iterations:
$ ./parrot perl6.pbc -e "$(cat x)"
1
2
3
[...4 through 171...]
172
173
174
Segmentation fault
Somewhat surprisingly, both reading from a file and executing via -e
produce the exact same PIR output:
$ ./parrot perl6.pbc --target=pir x >x.pir
$ ./parrot perl6.pbc --target=pir -e "$(cat x)" >e.pir
$ diff e.pir x.pir
$
To turn the generated .pir file into standalone executable,
add a load_bytecode 'perl6.pbc' opcode inside of the first
sub. This then segfaults after 352 iterations:
$ vi x.pir
...
$ head -6 x.pir
.namespace
.sub "_block11"
load_bytecode 'perl6.pbc'
.lex "$_", $P12
.lex "$/", $P13
$ ./parrot x.pir
1
2
3
[...4 through 349...]
350
351
352
Hope this helps,
Pm