pike.git / src / opcodes.c

version» Context lines:

pike.git/src/opcodes.c:18:   #include "error.h"   #include "pike_types.h"   #include "pike_memory.h"   #include "fd_control.h"   #include "cyclic.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "security.h"   #include "bignum.h"    - RCSID("$Id: opcodes.c,v 1.52 1999/10/26 17:52:48 noring Exp $"); + RCSID("$Id: opcodes.c,v 1.53 1999/10/28 22:27:31 noring Exp $");      void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)   {    INT32 i;      #ifdef PIKE_SECURITY    if(what->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(what->u.array, SECURITY_BIT_INDEX))    error("Index permission denied.\n");   #endif
pike.git/src/opcodes.c:879:    if(eye+field_length > input_len)    {    chars_matched[0]=eye;    return matches;    }    sval.type=T_INT;    sval.subtype=NUMBER_NUMBER;    sval.u.integer=0;    if (minus_flag)    { -  int pos=0; +  int x, pos=0; +     while(--field_length >= 0)    { -  sval.u.integer|=(EXTRACT_UCHAR(input+eye))<<pos; +  x = EXTRACT_UCHAR(input+eye); +  + #ifdef AUTO_BIGNUM +  if(INT_TYPE_LSH_OVERFLOW(x, pos)) +  { +  int lshfun, orfun; +  push_int(sval.u.integer); +  convert_stack_top_to_bignum(); +  lshfun=FIND_LFUN(sp[-1].u.object->prog, LFUN_LSH); +  orfun=FIND_LFUN(sp[-1].u.object->prog, LFUN_OR); +  +  while(field_length-- >= 0) +  { +  push_int(EXTRACT_UCHAR(input+eye)); +  convert_stack_top_to_bignum(); +  push_int(pos); +  apply_low(sp[-2].u.object, lshfun, 1); +  stack_swap(); +  pop_stack(); +  apply_low(sp[-2].u.object, orfun, 1); +  stack_swap(); +  pop_stack();    pos+=8;    eye++;    } -  +  sval=*--sp; +  break;    }    else -  + #endif /* AUTO_BIGNUM */ +  sval.u.integer|=x<<pos; +  +  pos+=8; +  eye++; +  } +  } +  else    while(--field_length >= 0)    { -  + #ifdef AUTO_BIGNUM +  if(INT_TYPE_LSH_OVERFLOW(sval.u.integer, 8)) +  { +  int lshfun, orfun; +  push_int(sval.u.integer); +  convert_stack_top_to_bignum(); +  lshfun=FIND_LFUN(sp[-1].u.object->prog, LFUN_LSH); +  orfun=FIND_LFUN(sp[-1].u.object->prog, LFUN_OR); +  +  while(field_length-- >= 0) +  { +  push_int(8); +  apply_low(sp[-2].u.object, lshfun, 1); +  stack_swap(); +  pop_stack(); +  push_int(EXTRACT_UCHAR(input+eye)); +  apply_low(sp[-2].u.object, orfun, 1); +  stack_swap(); +  pop_stack(); +  eye++; +  } +  sval=*--sp; +  break; +  } +  else + #endif /* AUTO_BIGNUM */    sval.u.integer<<=8;    sval.u.integer|=EXTRACT_UCHAR(input+eye);    eye++;    }    break;       case 'b':    case 'o':    case 'd':    case 'x':