Bill Allombert on Sat, 13 Nov 1999 14:23:29 +0100 (MET)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: trace() bug


>? allocatemem()
>  ***   Warning: doubling stack size; new stack = 8000000.
>? trace([;])
>  ***   segmentation fault: bug in GP (please report).

Well, my patch for gtrace was incorrect.
Here a new one (cumulative).

I hope this is one is good.
(CVS version updated)
Index: src/basemath/alglin2.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/basemath/alglin2.c,v
retrieving revision 1.7
diff -u -r1.7 alglin2.c
--- src/basemath/alglin2.c      1999/11/08 14:56:14     1.7
+++ src/basemath/alglin2.c      1999/11/13 13:15:48
@@ -544,8 +544,8 @@
       return y;

     case t_MAT:
-      lx=lg(x); if (lx!=lg(x[1])) err(mattype1,"gtrace");
-      if (lx==1) return gzero;/*now lx>=2*/
+      lx=lg(x); if (lx==1) return gzero;/*now lx>=2*/
+      if (lx!=lg(x[1])) err(mattype1,"gtrace");
       l=avma; p1=gcoeff(x,1,1); if (lx==2) return gcopy(p1);
       for (i=2; i<lx-1; i++)
        p1=gadd(p1,gcoeff(x,i,i));