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.60 2000/06/24 00:48:13 hubbe Exp $"); + RCSID("$Id: encode.c,v 1.61 2000/07/07 01:27:16 hubbe Exp $");      /* #define ENCODE_DEBUG */      #ifdef ENCODE_DEBUG   #define EDB(X) X   #else   #define EDB(X)   #endif      #ifdef _AIX
pike.git/src/encode.c:304:    struct program *p=id_to_program(x);    if(p)    {    ref_push_program(p);    }else{    push_int(0);    }    }else{    push_int(0);    } -  encode_value2(sp-1, data); +  encode_value2(Pike_sp-1, data);    pop_stack();    break;    }    }    return t-q;   }         static void encode_value2(struct svalue *val, struct encode_data *data)      #ifdef PIKE_DEBUG   #undef encode_value2 - #define encode_value2(X,Y) do { struct svalue *_=sp; encode_value2_(X,Y); if(sp!=_) fatal("encode_value2 failed!\n"); } while(0) + #define encode_value2(X,Y) do { struct svalue *_=Pike_sp; encode_value2_(X,Y); if(Pike_sp!=_) fatal("encode_value2 failed!\n"); } while(0)   #endif      {    static struct svalue dested = { T_INT, NUMBER_DESTRUCTED };    INT32 i;    struct svalue *tmp;       if((val->type == T_OBJECT || (val->type==T_FUNCTION && \    val->subtype!=FUNCTION_BUILTIN)) && !val->u.object->prog)    val=&dested;
pike.git/src/encode.c:411:    if (data->canonic) {    INT32 *order;    if (val->u.mapping->data->ind_types & ~(BIT_BASIC & ~BIT_TYPE)) {    mapping_fix_type_field(val->u.mapping);    if (val->u.mapping->data->ind_types & ~(BIT_BASIC & ~BIT_TYPE))    /* This doesn't let bignums through. That's necessary as    * long as they aren't handled deterministically by the    * sort function. */    error("Canonical encoding requires basic types in indices.\n");    } -  order = get_switch_order(sp[-2].u.array); -  order_array(sp[-2].u.array, order); -  order_array(sp[-1].u.array, order); +  order = get_switch_order(Pike_sp[-2].u.array); +  order_array(Pike_sp[-2].u.array, order); +  order_array(Pike_sp[-1].u.array, order);    free((char *) order);    }    -  code_entry(TAG_MAPPING, sp[-2].u.array->size,data); -  for(i=0; i<sp[-2].u.array->size; i++) +  code_entry(TAG_MAPPING, Pike_sp[-2].u.array->size,data); +  for(i=0; i<Pike_sp[-2].u.array->size; i++)    { -  encode_value2(ITEM(sp[-2].u.array)+i, data); /* indices */ -  encode_value2(ITEM(sp[-1].u.array)+i, data); /* values */ +  encode_value2(ITEM(Pike_sp[-2].u.array)+i, data); /* indices */ +  encode_value2(ITEM(Pike_sp[-1].u.array)+i, data); /* values */    }    pop_n_elems(2);    break;       case T_MULTISET:    code_entry(TAG_MULTISET, val->u.multiset->ind->size,data);    if (data->canonic) {    INT32 *order;    if (val->u.multiset->ind->type_field & ~(BIT_BASIC & ~BIT_TYPE)) {    array_fix_type_field(val->u.multiset->ind);    if (val->u.multiset->ind->type_field & ~(BIT_BASIC & ~BIT_TYPE))    /* This doesn't let bignums through. That's necessary as    * long as they aren't handled deterministically by the    * sort function. */    error("Canonical encoding requires basic types in indices.\n");    }    check_stack(1);    ref_push_array(val->u.multiset->ind); -  order = get_switch_order(sp[-1].u.array); -  order_array(sp[-1].u.array, order); +  order = get_switch_order(Pike_sp[-1].u.array); +  order_array(Pike_sp[-1].u.array, order);    free((char *) order); -  for (i = 0; i < sp[-1].u.array->size; i++) -  encode_value2(ITEM(sp[-1].u.array)+i, data); +  for (i = 0; i < Pike_sp[-1].u.array->size; i++) +  encode_value2(ITEM(Pike_sp[-1].u.array)+i, data);    pop_stack();    }    else    for(i=0; i<val->u.multiset->ind->size; i++)    encode_value2(ITEM(val->u.multiset->ind)+i, data);    break;       case T_OBJECT:    check_stack(1);   
pike.git/src/encode.c:467: Inside #if defined(AUTO_BIGNUM)
   * but that will have to wait until next time. /Hubbe    */    if(is_bignum_object(val->u.object))    {    code_entry(TAG_OBJECT, 2, data);    /* 256 would be better, but then negative numbers    * doesn't work... /Hubbe    */    push_int(36);    apply(val->u.object,"digits",1); -  if(sp[-1].type != T_STRING) +  if(Pike_sp[-1].type != T_STRING)    error("Gmp.mpz->digits did not return a string!\n"); -  encode_value2(sp-1, data); +  encode_value2(Pike_sp-1, data);    pop_stack();    break;    }   #endif       if (data->canonic)    error("Canonical encoding of objects not supported.\n");    push_svalue(val);    apply(data->codec, "nameof", 1); -  switch(sp[-1].type) +  switch(Pike_sp[-1].type)    {    case T_INT: -  if(sp[-1].subtype == NUMBER_UNDEFINED) +  if(Pike_sp[-1].subtype == NUMBER_UNDEFINED)    {    pop_stack();    push_svalue(val);    f_object_program(1);       code_entry(type_to_tag(val->type), 1,data); -  encode_value2(sp-1, data); +  encode_value2(Pike_sp-1, data);    pop_stack();       push_svalue(val);    apply(data->codec,"encode_object",1);    break;    }    /* FALL THROUGH */       default:    code_entry(type_to_tag(val->type), 0,data);    break;    } -  encode_value2(sp-1, data); +  encode_value2(Pike_sp-1, data);    pop_stack();    break;       case T_FUNCTION:    if (data->canonic)    error("Canonical encoding of functions not supported.\n");    check_stack(1);    push_svalue(val);    apply(data->codec,"nameof", 1); -  if(sp[-1].type == T_INT && sp[-1].subtype==NUMBER_UNDEFINED) +  if(Pike_sp[-1].type == T_INT && Pike_sp[-1].subtype==NUMBER_UNDEFINED)    {    if(val->subtype != FUNCTION_BUILTIN)    {    int eq;       code_entry(type_to_tag(val->type), 1, data);    push_svalue(val); -  sp[-1].type=T_OBJECT; +  Pike_sp[-1].type=T_OBJECT;    ref_push_string(ID_FROM_INT(val->u.object->prog, val->subtype)->name);    f_arrow(2); -  eq=is_eq(sp-1, val); +  eq=is_eq(Pike_sp-1, val);    pop_stack();    if(eq)    {    /* We have to remove ourself from the cache for now */    struct svalue tmp=data->counter;    tmp.u.integer--;    map_delete(data->encoded, val);       push_svalue(val); -  sp[-1].type=T_OBJECT; -  encode_value2(sp-1, data); +  Pike_sp[-1].type=T_OBJECT; +  encode_value2(Pike_sp-1, data);    ref_push_string(ID_FROM_INT(val->u.object->prog, val->subtype)->name); -  encode_value2(sp-1, data); +  encode_value2(Pike_sp-1, data);    pop_n_elems(3);       /* Put value back in cache */    mapping_insert(data->encoded, val, &tmp);    return;    }    }    }       code_entry(type_to_tag(val->type), 0,data); -  encode_value2(sp-1, data); +  encode_value2(Pike_sp-1, data);    pop_stack();    break;          case T_PROGRAM:    {    int d;    if (data->canonic)    error("Canonical encoding of programs not supported.\n");    check_stack(1);    push_svalue(val);    apply(data->codec,"nameof", 1); -  if(sp[-1].type == val->type) +  if(Pike_sp[-1].type == val->type)    error("Error in master()->nameof(), same type returned.\n"); -  if(sp[-1].type == T_INT && sp[-1].subtype == NUMBER_UNDEFINED) +  if(Pike_sp[-1].type == T_INT && Pike_sp[-1].subtype == NUMBER_UNDEFINED)    {    INT32 e;    struct program *p=val->u.program;    if(p->init || p->exit || p->gc_recurse_func || p->gc_check_func ||    (p->flags & PROGRAM_HAS_C_METHODS))    error("Cannot encode C programs.\n");    code_entry(type_to_tag(val->type), 1,data);    f_version(0); -  encode_value2(sp-1,data); +  encode_value2(Pike_sp-1,data);    pop_stack();    code_number(p->flags,data);    code_number(p->storage_needed,data);    code_number(p->alignment_needed,data);    code_number(p->timestamp.tv_sec,data);    code_number(p->timestamp.tv_usec,data);      #define FOO(X,Y,Z) \    code_number( p->num_##Z, data);   #include "program_areas.h"
pike.git/src/encode.c:611:    for(d=0;d<p->num_inherits;d++)    {    code_number(p->inherits[d].inherit_level,data);    code_number(p->inherits[d].identifier_level,data);    code_number(p->inherits[d].parent_offset,data);    code_number(p->inherits[d].storage_offset,data);       if(p->inherits[d].parent)    {    ref_push_object(p->inherits[d].parent); -  sp[-1].subtype=p->inherits[d].parent_identifier; -  sp[-1].type=T_FUNCTION; +  Pike_sp[-1].subtype=p->inherits[d].parent_identifier; +  Pike_sp[-1].type=T_FUNCTION;    }else if(p->inherits[d].prog){    ref_push_program(p->inherits[d].prog);    }else{    push_int(0);    } -  encode_value2(sp-1,data); +  encode_value2(Pike_sp-1,data);    pop_stack();       adddata3(p->inherits[d].name);    }       for(d=0;d<p->num_identifiers;d++)    {    adddata(p->identifiers[d].name);    encode_type(p->identifiers[d].type->str, data);    code_number(p->identifiers[d].identifier_flags,data);
pike.git/src/encode.c:643:    for(d=0;d<p->num_constants;d++)    {    encode_value2(& p->constants[d].sval, data);    adddata3(p->constants[d].name);    }       for(d=0;d<NUM_LFUNS;d++)    code_number(p->lfuns[d], data);    }else{    code_entry(type_to_tag(val->type), 0,data); -  encode_value2(sp-1, data); +  encode_value2(Pike_sp-1, data);    }    pop_stack();    break;    }    }   }      static void free_encode_data(struct encode_data *data)   {    toss_buffer(& data->buf);
pike.git/src/encode.c:672:       check_all_args("encode_value", args, BIT_MIXED, BIT_VOID | BIT_OBJECT, 0);       initialize_buf(&data->buf);    data->canonic = 0;    data->encoded=allocate_mapping(128);    data->counter.type=T_INT;    data->counter.u.integer=COUNTER_START;    if(args > 1)    { -  data->codec=sp[1-args].u.object; +  data->codec=Pike_sp[1-args].u.object;    }else{    data->codec=get_master();    }       SET_ONERROR(tmp, free_encode_data, data);    addstr("\266ke0", 4); -  encode_value2(sp-args, data); +  encode_value2(Pike_sp-args, data);    UNSET_ONERROR(tmp);       free_mapping(data->encoded);       pop_n_elems(args);    push_string(low_free_buf(&data->buf));   }      void f_encode_value_canonic(INT32 args)   {
pike.git/src/encode.c:703:       check_all_args("encode_value_canonic", args, BIT_MIXED, BIT_VOID | BIT_OBJECT, 0);       initialize_buf(&data->buf);    data->canonic = 1;    data->encoded=allocate_mapping(128);    data->counter.type=T_INT;    data->counter.u.integer=COUNTER_START;    if(args > 1)    { -  data->codec=sp[1-args].u.object; +  data->codec=Pike_sp[1-args].u.object;    }else{    data->codec=get_master();    }       SET_ONERROR(tmp, free_encode_data, data);    addstr("\266ke0", 4); -  encode_value2(sp-args, data); +  encode_value2(Pike_sp-args, data);    UNSET_ONERROR(tmp);       free_mapping(data->encoded);       pop_n_elems(args);    push_string(low_free_buf(&data->buf));   }      struct decode_data   {
pike.git/src/encode.c:865:   }      static void restore_type_mark(unsigned char **old_type_mark_stackp)   {   #if 0    fprintf(stderr, "Restoring type-mark: %p => %p\n",    Pike_compiler->pike_type_mark_stackp, old_type_mark_stackp);   #endif /* 0 */   #ifdef PIKE_DEBUG    if (old_type_mark_stackp > Pike_compiler->pike_type_mark_stackp) { -  fatal("type mark_stack out of sync!\n"); +  fatal("type Pike_interpreter.mark_stack out of sync!\n");    }   #endif /* PIKE_DEBUG */    Pike_compiler->pike_type_mark_stackp = old_type_mark_stackp;   }      static void low_decode_type(struct decode_data *data)   {    /* FIXME: Probably ought to use the tag encodings too. */       int tmp;
pike.git/src/encode.c:953:    case T_UNKNOWN:    break;       case T_OBJECT:    {    INT32 x;       push_type(GETC());    decode_value2(data);    type_stack_mark(); -  switch(sp[-1].type) +  switch(Pike_sp[-1].type)    {    case T_INT:    push_type_int(0);    break;       case T_PROGRAM: -  push_type_int(sp[-1].u.program->id); +  push_type_int(Pike_sp[-1].u.program->id);    break;       case T_FUNCTION:    {    struct program *prog; -  if (sp[-1].subtype == FUNCTION_BUILTIN) { +  if (Pike_sp[-1].subtype == FUNCTION_BUILTIN) {    error("Failed to decode object type.\n");    } -  prog = program_from_svalue(sp-1); +  prog = program_from_svalue(Pike_sp-1);    if (!prog) {    error("Failed to decode object type.\n");    }    push_type_int(prog->id);    }    break;       default:    error("Failed to decode type "    "(object(%s), expected object(zero|program)).\n", -  get_name_of_type(sp[-1].type)); +  get_name_of_type(Pike_sp[-1].type));    }    pop_stack();    type_stack_reverse();    }    }       UNSET_ONERROR(err2);    UNSET_ONERROR(err1);   }   
pike.git/src/encode.c:1004:    type_stack_mark(); \    low_decode_type(data); \    type_stack_reverse(); \    (X)=pop_unfinished_type(); \   } while(0)      static void decode_value2(struct decode_data *data)      #ifdef PIKE_DEBUG   #undef decode_value2 - #define decode_value2(X) do { struct svalue *_=sp; decode_value2_(X); if(sp!=_+1) fatal("decode_value2 failed!\n"); } while(0) + #define decode_value2(X) do { struct svalue *_=Pike_sp; decode_value2_(X); if(Pike_sp!=_+1) fatal("decode_value2 failed!\n"); } while(0)   #endif         {    INT32 what, e, num;    struct svalue tmp, *tmp2;       DECODE("decode_value2");       check_stack(1);
pike.git/src/encode.c:1089:       /* Since a reference to the array is stored in the mapping, we can    * safely decrease this reference here. Thus it will be automatically    * freed if something goes wrong.    */    a->refs--;       for(e=0;e<num;e++)    {    decode_value2(data); -  ITEM(a)[e]=sp[-1]; -  sp--; -  dmalloc_touch_svalue(sp); +  ITEM(a)[e]=Pike_sp[-1]; +  Pike_sp--; +  dmalloc_touch_svalue(Pike_sp);    }    ref_push_array(a);    return;    }       case TAG_MAPPING:    {    struct mapping *m;    if(num<0)    error("Failed to decode string. (mapping size is negative)\n");
pike.git/src/encode.c:1118:    tmp.type=T_MAPPING;    tmp.u.mapping=m;    mapping_insert(data->decoded, & data->counter, &tmp);    data->counter.u.integer++;    m->refs--;       for(e=0;e<num;e++)    {    decode_value2(data);    decode_value2(data); -  mapping_insert(m, sp-2, sp-1); +  mapping_insert(m, Pike_sp-2, Pike_sp-1);    pop_n_elems(2);    }    ref_push_mapping(m);    return;    }       case TAG_MULTISET:    {    struct multiset *m;    if(num<0)
pike.git/src/encode.c:1146:    tmp.type=T_MULTISET;    tmp.u.multiset=m;    mapping_insert(data->decoded, & data->counter, &tmp);    data->counter.u.integer++;    m->refs--;    debug_malloc_touch(m);       for(e=0;e<num;e++)    {    decode_value2(data); -  multiset_insert(m, sp-1); +  multiset_insert(m, Pike_sp-1);    pop_stack();    }    ref_push_multiset(m);    return;    }          case TAG_OBJECT:    tmp=data->counter;    data->counter.u.integer++;
pike.git/src/encode.c:1173:    {    apply(data->codec,"objectof", 1);    }else{    ref_push_mapping(get_builtin_constants());    stack_swap();    f_index(2);    }    break;       case 1: -  if(IS_ZERO(sp-1)) +  if(IS_ZERO(Pike_sp-1))    { -  mapping_insert(data->decoded, &tmp, sp-1); +  mapping_insert(data->decoded, &tmp, Pike_sp-1);    decode_value2(data);    pop_stack();    }else{    f_call_function(1); -  mapping_insert(data->decoded, &tmp, sp-1); -  push_svalue(sp-1); +  mapping_insert(data->decoded, &tmp, Pike_sp-1); +  push_svalue(Pike_sp-1);    decode_value2(data);    if(!data->codec)    error("Failed to decode (no codec)\n");    apply(data->codec,"decode_object",2);    pop_stack();    } -  if(data->pickyness && sp[-1].type != T_OBJECT) +  if(data->pickyness && Pike_sp[-1].type != T_OBJECT)    error("Failed to decode object.\n");    return;      #ifdef AUTO_BIGNUM    /* It is possible that we should do this even without    * AUTO_BIGNUM /Hubbe    * However, that requires that some of the bignum functions    * are always available...    */    case 2:
pike.git/src/encode.c:1215: Inside #if defined(AUTO_BIGNUM)
   convert_stack_top_with_base_to_bignum();    break;    }      #endif       default:    error("Object coding not compatible.\n");    break;    } -  if(data->pickyness && sp[-1].type != T_OBJECT) +  if(data->pickyness && Pike_sp[-1].type != T_OBJECT)    error("Failed to decode (got type %d; expected object).\n", -  sp[-1].type); +  Pike_sp[-1].type);    break;       case TAG_FUNCTION:    tmp=data->counter;    data->counter.u.integer++;    decode_value2(data);       switch(num)    {    case 0:
pike.git/src/encode.c:1240:    apply(data->codec,"functionof", 1);    }else{    ref_push_mapping(get_builtin_constants());    stack_swap();    f_index(2);    }    break;       case 1:    decode_value2(data); -  if(sp[-2].type==T_INT) +  if(Pike_sp[-2].type==T_INT)    {    pop_stack();    }else{    f_arrow(2);    }    break;       default:    error("Function coding not compatible.\n");    break;    } -  if(data->pickyness && sp[-1].type != T_FUNCTION) +  if(data->pickyness && Pike_sp[-1].type != T_FUNCTION)    error("Failed to decode function.\n");    break;          case TAG_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; +  prog_code = Pike_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 && !program_from_svalue(sp-1)) { +  if(data->pickyness && !program_from_svalue(Pike_sp-1)) {    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();
pike.git/src/encode.c:1319:    p=low_allocate_program();    debug_malloc_touch(p);    tmp.type=T_PROGRAM;    tmp.u.program=p;    mapping_insert(data->decoded, & data->counter, &tmp);    data->counter.u.integer++;    p->refs--;       decode_value2(data);    f_version(0); -  if(!is_eq(sp-1,sp-2)) +  if(!is_eq(Pike_sp-1,Pike_sp-2))    error("Cannot decode programs encoded with other driver version.\n");    pop_n_elems(2);       decode_number(p->flags,data);    p->flags &= ~(PROGRAM_FINISHED | PROGRAM_OPTIMIZED);    p->flags |= PROGRAM_AVOID_CHECK;    decode_number(p->storage_needed,data);    decode_number(p->alignment_needed,data);    decode_number(p->timestamp.tv_sec,data);    decode_number(p->timestamp.tv_usec,data);
pike.git/src/encode.c:1431:    for(d=0;d<p->num_inherits;d++)    {    decode_number(p->inherits[d].inherit_level,data);    decode_number(p->inherits[d].identifier_level,data);    decode_number(p->inherits[d].parent_offset,data);    decode_number(p->inherits[d].storage_offset,data);       decode_value2(data);    if(d==0)    { -  if(sp[-1].type != T_PROGRAM || -  sp[-1].u.program != p) +  if(Pike_sp[-1].type != T_PROGRAM || +  Pike_sp[-1].u.program != p)    error("Program decode failed!\n");    p->refs--;    }    -  switch(sp[-1].type) +  switch(Pike_sp[-1].type)    {    case T_FUNCTION: -  if(sp[-1].subtype == FUNCTION_BUILTIN) +  if(Pike_sp[-1].subtype == FUNCTION_BUILTIN)    error("Failed to decode parent.\n");    -  p->inherits[d].parent_identifier=sp[-1].subtype; -  p->inherits[d].prog=program_from_svalue(sp-1); +  p->inherits[d].parent_identifier=Pike_sp[-1].subtype; +  p->inherits[d].prog=program_from_svalue(Pike_sp-1);    if(!p->inherits[d].prog)    error("Failed to decode parent.\n");    add_ref(p->inherits[d].prog); -  p->inherits[d].parent=sp[-1].u.object; -  sp--; -  dmalloc_touch_svalue(sp); +  p->inherits[d].parent=Pike_sp[-1].u.object; +  Pike_sp--; +  dmalloc_touch_svalue(Pike_sp);    break;       case T_PROGRAM:    p->inherits[d].parent_identifier=0; -  p->inherits[d].prog=sp[-1].u.program; -  sp--; -  dmalloc_touch_svalue(sp); +  p->inherits[d].prog=Pike_sp[-1].u.program; +  Pike_sp--; +  dmalloc_touch_svalue(Pike_sp);    break;    default:    error("Failed to decode inheritance.\n");    }       getdata3(p->inherits[d].name);    }       debug_malloc_touch(dat);   
pike.git/src/encode.c:1488:    }       UNSET_ONERROR(err2);    UNSET_ONERROR(err1);       debug_malloc_touch(dat);       for(d=0;d<p->num_constants;d++)    {    decode_value2(data); -  p->constants[d].sval=*--sp; -  dmalloc_touch_svalue(sp); +  p->constants[d].sval=*--Pike_sp; +  dmalloc_touch_svalue(Pike_sp);    getdata3(p->constants[d].name);    }    data->pickyness--;       debug_malloc_touch(dat);       for(d=0;d<NUM_LFUNS;d++)    decode_number(p->lfuns[d],data);       debug_malloc_touch(dat);
pike.git/src/encode.c:1533:       default:    error("Cannot decode program encoding type %d\n",num);    }    break;       default:    error("Failed to restore string. (Illegal type)\n");    }    -  mapping_insert(data->decoded, & tmp, sp-1); +  mapping_insert(data->decoded, & tmp, Pike_sp-1);   }         static void free_decode_data(struct decode_data *data)   {    free_mapping(data->decoded);   }      static INT32 my_decode(struct pike_string *tmp,    struct object *codec)
pike.git/src/encode.c:1612:    i=extract_int(v,l);    t=extract_int(v,l);    switch(i)    {    case TAG_INT: push_int(t); return;       case TAG_FLOAT:    if(sizeof(INT32) < sizeof(float)) /* FIXME FIXME FIXME FIXME */    error("Float architecture not supported.\n");    push_int(t); /* WARNING! */ -  sp[-1].type = T_FLOAT; +  Pike_sp[-1].type = T_FLOAT;    return;       case TAG_TYPE:    error("Format error:decoding of the type type not supported yet.\n");    return;       case TAG_STRING:    if(t<0) error("Format error, length of string is negative.\n");    if(*l < t) error("Format error, string to short\n");    push_string(make_shared_binary_string(*v, t));
pike.git/src/encode.c:1688:   }      void f_decode_value(INT32 args)   {    struct pike_string *s;    struct object *codec;       check_all_args("decode_value", args,    BIT_STRING, BIT_VOID | BIT_OBJECT | BIT_INT, 0);    -  s = sp[-args].u.string; +  s = Pike_sp[-args].u.string;    if(args<2)    {    codec=get_master();    } -  else if(sp[1-args].type == T_OBJECT) +  else if(Pike_sp[1-args].type == T_OBJECT)    { -  codec=sp[1-args].u.object; +  codec=Pike_sp[1-args].u.object;    }    else    {    codec=0;    }       if(!my_decode(s, codec))    {    char *v=s->str;    INT32 l=s->len;    rec_restore_value(&v, &l);    } -  assign_svalue(sp-args-1, sp-1); +  assign_svalue(Pike_sp-args-1, Pike_sp-1);    pop_n_elems(args);   }