pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:18:   #include "error.h"   #include "operators.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "fsort.h"   #include "threads.h"   #include "stuff.h"   #include "version.h"   #include "bignum.h"    - RCSID("$Id: encode.c,v 1.44 1999/11/03 19:26:30 grubba Exp $"); + RCSID("$Id: encode.c,v 1.45 1999/11/03 23:53:15 grubba Exp $");      /* #define ENCODE_DEBUG */      #ifdef ENCODE_DEBUG   #define EDB(X) X   #else   #define EDB(X)   #endif      #ifdef _AIX
pike.git/src/encode.c:1121:    }    if(data->pickyness && sp[-1].type != T_FUNCTION)    error("Failed to decode function.\n");    break;          case T_PROGRAM:    switch(num)    {    case 0: +  { +  struct svalue *prog_code; +     tmp=data->counter;    data->counter.u.integer++;    decode_value2(data); -  +  +  /* Keep the value so that we can make a good error-message. */ +  prog_code = sp-1; +  stack_dup(); +     if(data->codec)    {    apply(data->codec,"programof", 1);    }else{    ref_push_mapping(get_builtin_constants());    stack_swap();    f_index(2);    } -  if(data->pickyness && sp[-1].type != T_PROGRAM) +  if(data->pickyness && sp[-1].type != T_PROGRAM) { +  if ((prog_code->type == T_STRING) && +  (prog_code->u.string->len < 128) && +  (!prog_code->u.string->size_shift)) { +  error("Failed to decode program \"%s\".\n", +  prog_code->u.string->str); +  }    error("Failed to decode program.\n"); -  +  } +  /* Remove the extra entry from the stack. */ +  stack_swap(); +  pop_stack();    break; -  +  }    case 1:    {    int d;    SIZE_T size=0;    char *dat;    struct program *p;    ONERROR err1;    ONERROR err2;      #ifdef _REENTRANT