Package: gp2c
Version: 0.0.9pl3
Indexing with a Vecsmall leads to
a segmentation fault after compilation
with gp2c.
I encountered this problem with a
Vecsmall returned by select(f,v,1).
I have contrived a minimal example:
Vecsmallbug.gp
vsb(n)=
{
my(u,v);
u=Vecsmall(1,n);
v=vector(n);
print(u);
for(i=1,n,v[i]=u[i]);
v
}
gp Vecsmallbug.gp
Reading GPRC:.gprc ...Done.
GP/PARI CALCULATOR Version 2.7.5
amd64 running linux
gcc version 4.5.1
>> vsb(5)
Vecsmall([1, 0, 0, 0, 0])
%1 = [1, 0, 0, 0, 0]
>> \q
Goodbye!
gp2c-run -g Vecsmallbug.gp
Reading GPRC:.gprc ...Done.
>> vsb(5)
Vecsmall([1, 0, 0, 0, 0])
*** at top-level: vsb(5)
*** ^------
*** vsb: bug (Segmentation Fault)