> < ^ Date: Sat, 15 Aug 1992 14:10:10 +0200
> < ^ From: Werner Nickel <nickel@mathematik.tu-darmstadt.de >
^ Subject: Bug in list assignment ?
gap> L := [];
[  ]
gap> L[0] := 0;
Error, List assignment: <index> must be a positive int
gap> L[-1] := -1;
-1;
gap> L[-1000000] := 0;
Segmentation fault

Here is the bug fix:

*** list.orig   Sat Aug 15 22:00:18 1992
--- list.c      Sat Aug 15 22:07:39 1992
***************
*** 303,309 ****
  {
      TypHandle           hdList;         /* handle of the list              */
      unsigned long       type;           /* type of the list                */
!     unsigned long       ind;            /* index into the list             */
      TypHandle           hdElm;          /* handle of the selected element  */

      /* evaluate the list                                                   */
--- 303,309 ----
  {
      TypHandle           hdList;         /* handle of the list              */
      unsigned long       type;           /* type of the list                */
!              long       ind;            /* index into the list             */
      TypHandle           hdElm;          /* handle of the selected element  */

      /* evaluate the list                                                   */
***************
*** 391,397 ****
  {
      TypHandle           hdList;         /* handle of the list              */
      unsigned long       type;           /* type of the list                */
!     unsigned long       ind;            /* index into the list             */
      TypHandle           hdObj;          /* handle of the object            */
      unsigned long       l;              /* physical length of the list     */

--- 391,397 ----
  {
      TypHandle           hdList;         /* handle of the list              */
      unsigned long       type;           /* type of the list                */
!              long       ind;            /* index into the list             */
      TypHandle           hdObj;          /* handle of the object            */
      unsigned long       l;              /* physical length of the list     */

Werner Nickel
Mathematics Research Section
Australian National University


> < [top]