Branch: Tag:

1999-03-19

1999-03-19 11:40:15 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

now uses objects as exceptions in some cases

Rev: src/array.c:1.45
Rev: src/builtin_functions.c:1.156
Rev: src/module_support.c:1.21

20:   #include "main.h"   #include "security.h"    - RCSID("$Id: array.c,v 1.44 1999/03/05 02:14:31 hubbe Exp $"); + RCSID("$Id: array.c,v 1.45 1999/03/19 11:40:12 hubbe Exp $");      struct array empty_array=   {
168:    i=ind->u.integer;    if(i<0) i+=a->size;    if(i<0 || i>=a->size) { +  struct svalue tmp; +  tmp.type=T_ARRAY; +  tmp.u.array=a;    if (a->size) { -  error("Index %d is out of range 0 - %d.\n", i, a->size-1); +  index_error(0,0,0,&tmp,ind,"Index %d is out of range 0 - %d.\n", i, a->size-1);    } else { -  error("Attempt to index the empty array with %d.\n", i); +  index_error(0,0,0,&tmp,ind,"Attempt to index the empty array with %d.\n", i);    }    }    array_index_no_free(s,a,i);
187:    break;       default: -  error("Index is not an integer.\n"); +  { +  struct svalue tmp; +  tmp.type=T_ARRAY; +  tmp.u.array=a; +  index_error(0,0,0,&tmp,ind,"Index is not an integer.\n");    }    } -  + }      /*    * Extract an svalue from an array