# New Ticket Created by Patrick R. Michaud
# Please include the string: [perl #37561]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37561 >
---
osname= linux
osvers= 2.4.21-27.0.2.elsmp
arch= i386-linux-thread-multi
cc= gcc 4.0.0 20050516 (Red Hat 4.0.0-6)
---
Flags:
category=core
severity=high
ack=no
---
The script below using :slurpy gives incorrect results (r9620).
The "xyz" subroutine is supposed to receive a :slurpy list of
arguments, removes the last one if it is "POPME", and then
prints whatever arguments are left.
However, there appears to be a register conflict somewhere,
because in the line "$P0 = pop args" both "$P0" and "args" end
up using the same register, thus xyz ends up displaying
P
O
P
M
E
I'm also commiting this test to t/op/calling.t .
.sub main :main
xyz("abc", "def")
xyz("ghi", "jkl", "POPME")
.end
.sub xyz
.param pmc args :slurpy
$S0 = args[-1]
if $S0 != "POPME" goto start
$P0 = pop args
start:
$I1 = elements args
$I0 = 0
loop:
if $I0 >= $I1 goto end
$S0 = args[$I0]
print $S0
print "\n"
inc $I0
goto loop
end:
.end
$ ./parrot t.pir
abc
def
P
O
P
M
E
$
Thanks,
Pm
---
Summary of my parrot 0.3.0 (r9620) configuration:
configdate='Fri Oct 28 16:17:49 2005'
Platform:
osname=linux, archname=i386-linux-thread-multi
jitcapable=1, jitarchname=i386-linux,
jitosname=LINUX, jitcpuarch=i386
execcapable=1
perl=/usr/bin/perl
Compiler:
cc='gcc', ccflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/include/gdbm',
Linker and Libraries:
ld='gcc', ldflags=' -L/usr/local/lib',
cc_ldflags='',
libs='-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp'
Dynamic Linking:
share_ext='.so', ld_share_flags='-shared -L/usr/local/lib -fPIC',
load_ext='.so', ld_load_flags='-shared -L/usr/local/lib -fPIC'
Types:
iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4,
ptrsize=4, ptr_alignment=1 byteorder=1234,
nv=double, numvalsize=8, doublesize=8
---
Environment:
HOME LANG LANGUAGE LD_LIBRARY_PATH LOGDIR PATH SHELL