pike.git / src / operators.c

version» Context lines:

pike.git/src/operators.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include <math.h>   #include "global.h" - RCSID("$Id: operators.c,v 1.3 1996/11/14 01:36:30 hubbe Exp $"); + RCSID("$Id: operators.c,v 1.4 1996/11/27 03:47:02 hubbe Exp $");   #include "interpret.h"   #include "svalue.h"   #include "multiset.h"   #include "mapping.h"   #include "array.h"   #include "stralloc.h"   #include "opcodes.h"   #include "operators.h"   #include "language.h"   #include "memory.h"
pike.git/src/operators.c:1095:    case T_STRING:    {    struct pike_string *s;    if(to>=sp[-1].u.string->len-1)    {    if(from==0) return;    to=sp[-1].u.string->len-1;       if(from>to+1) from=to+1;    } + #ifdef DEBUG +  if(from < 0 || (to-from+1) < 0) +  fatal("Error in o_range.\n"); + #endif       s=make_shared_binary_string(sp[-1].u.string->str+from,to-from+1);    free_string(sp[-1].u.string);    sp[-1].u.string=s;    break;    }       case T_ARRAY:    {    struct array *a;